javax.swing.JLabel.paint()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中javax.swing.JLabel.paint()方法的一些代码示例,展示了JLabel.paint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.paint()方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:paint

JLabel.paint介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

label.paint(g);
g.dispose();

代码示例来源:origin: dboissier/mongo4idea

@Override
  protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    if (!getServerConfigurations().isEmpty()) return;
    myLabel.setFont(getFont());
    myLabel.setBackground(getBackground());
    myLabel.setForeground(getForeground());
    Rectangle bounds = getBounds();
    Dimension size = myLabel.getPreferredSize();
    myLabel.setBounds(0, 0, size.width, size.height);
    int x = (bounds.width - size.width) / 2;
    Graphics g2 = g.create(bounds.x + x, bounds.y + 20, bounds.width, bounds.height);
    try {
      myLabel.paint(g2);
    } finally {
      g2.dispose();
    }
  }
};

代码示例来源:origin: magefree/mage

labelG.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  labelG.fillOval(x + 1, y + 1, symbolWidth - 2, symbolWidth - 2);
  labelRender.paint(labelG);
} else {

代码示例来源:origin: org.java.net.substance/substance

@Override
public final void paint(Graphics g) {
  super.paint(g);
}

代码示例来源:origin: com.jalalkiswani/jk-desktop

@Override
public void paint(final Graphics g) {
  if (isOpaque()) {
    // setOpaque(false);
    // GraphicsFactory.makeGradient(this, g, getBackground());
    super.paint(g);
    // setOpaque(true);
  } else {
    super.paint(g);
  }
}

代码示例来源:origin: violetumleditor/violetumleditor

@Override
public void paint(Graphics g) {
((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity));
super.paint(g);
}

代码示例来源:origin: stackoverflow.com

public void paintComponent(Graphics g) {
  super.paintComponent(g);

  // Draw Text
  g.drawString("This is my custom Panel!",10,20);

  JLabel c = new JLabel("Label");
  c.setBounds(0, 0, 400, 30);
  c.paint(g);
}

代码示例来源:origin: com.jtattoo/JTattoo

public void paint(Graphics g) {
    paintBackground(g);
    super.paint(g);
  }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void paint(Graphics _g)
{
 BuLib.setAntialiasing(this,_g);
 super.paint(_g);
}

代码示例来源:origin: violetumleditor/violetumleditor

/**
 * Draws text shifted by offset
 * @param graphics
 * @param point
 */
public final void draw(Graphics2D graphics, Point2D point)
{
  graphics.translate(point.getX(), point.getY());
  getLabel().paint(graphics);
  graphics.translate(-point.getX(), -point.getY());
}

代码示例来源:origin: mikaelhg/openblocks

/**
 * updates BlockControlLbabel before painting
 */
public void paint(Graphics g) {
  update();
  super.paint(g);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

@Override
public void paintValue (Graphics gfx, Rectangle box) {
  renderer.setForeground(gfx.getColor());
  Object val = getValue();
  if (val instanceof Date) {
    val = DateFormat.getDateTimeInstance().format((Date) val);
  }
  renderer.setText(val.toString());
  renderer.setBounds(box);
  renderer.paint(gfx);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

@Override
public void paintValue (Graphics gfx, Rectangle box) {
  renderer.setForeground(gfx.getColor());
  Object val = getValue();
  if (val instanceof Date) {
    val = DateFormat.getDateTimeInstance().format((Date) val);
  }
  renderer.setText(val.toString());
  renderer.setBounds(box);
  renderer.paint(gfx);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

@Override
public void paintValue(Graphics gfx, Rectangle box) {
  renderer.setForeground(gfx.getColor());
  Object val = getValue();
  if (val instanceof Date) {
    val = DateFormat.getDateTimeInstance().format((Date) val);
  }
  renderer.setText(val.toString());
  renderer.setBounds(box);
  renderer.paint(gfx);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-screen

public void paint (Graphics g) {
  Graphics2D gr = (Graphics2D) g;
  gr.setPaint (new GradientPaint (0.0f, 0.0f, Color.WHITE, 0.0f, getHeight (), GRADIENT_COLOR));
  gr.fill (new Rectangle (getWidth (), getHeight ()));
  super.paint (g);
}

代码示例来源:origin: freeplane/freeplane

@Override
public void paint(final Graphics g) {
  switch (getMap().getPaintingMode()) {
    case CLOUDS:
      return;
    default:
      break;
  }
  super.paint(g);
}

代码示例来源:origin: Spoutcraft/LegacyLauncher

@Override
  public void paint(Graphics g) {
    g = transparency.setup(g);
    super.paint(g);
    transparency.cleanup(g);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

public void paint(Graphics g) {
  super.paint(g);
  if (!isFocusOwner() && getText().isEmpty())
    hintLabel.paint(g);
}

代码示例来源:origin: google/sagetv

public void paint(java.awt.Graphics g)
 {
  super.paint(g);
  java.awt.Color og = g.getColor();
  g.setColor(inSuspension ? java.awt.Color.red :
   (suspendExecution ? java.awt.Color.yellow : java.awt.Color.green));
  g.fillOval(conl.getWidth() - conl.getHeight() - 3, 3, conl.getHeight() - 6, conl.getHeight() - 6);
  g.setColor(og);
 }
};

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

public void paintComponent( Graphics g )
{
 _image.paintIcon( this, g, getInsets().left, getInsets().top );
 g.translate( _label.getX(), _label.getY() );
 _label.paint( g );
}

相关文章

JLabel类方法