Пример #1
1
 @Override
 public void paintChildren(Graphics g) {
   super.paintChildren(g);
   if (exitAfterFirstPaint) {
     System.exit(0);
   }
 }
Пример #2
0
  protected void paintChildren(final Graphics g) {
    super.paintChildren(g);

    if (myOverlayedIcon == null || myLabel.getParent() == null) return;

    final Rectangle textBounds =
        SwingUtilities.convertRectangle(myLabel.getParent(), myLabel.getBounds(), this);
    if (getLayeredIcon().isLayerEnabled(1)) {

      final int top = (getSize().height - myOverlayedIcon.getIconHeight()) / 2;

      myOverlayedIcon.paintIcon(this, g, textBounds.x - myOverlayedIcon.getIconWidth() / 2, top);
    }
  }
Пример #3
0
  public void paint(Graphics g) {

    Graphics2D g2D = (Graphics2D) g;
    //    g2D.addRenderingHints( new RenderingHints( RenderingHints.KEY_ANTIALIASING ,
    // RenderingHints.VALUE_ANTIALIAS_ON ));

    super.paint(g);

    super.paintChildren(g);
    // Paint Gradiant
    if (gradiantColor != null) {
      Color c1 = new Color(255, 255, 255, 0);
      int offset = (int) (getWidth() * gradiantOffsetRatio);
      GradientPaint gp =
          new GradientPaint(getWidth() - offset, 0, c1, getWidth(), 0, gradiantColor);
      g2D.setPaint(gp);
      g2D.fillRect(0, 0, getWidth(), getHeight());
    }
  }