g.setColor(b.getBackground());  if (b.isOpaque()) g.fillRect(vr.x, vr.y, vr.width, vr.height); else { g.fillRect(tr.x, tr.y, tr.width, tr.height); if (b.getBorder() != null) b.getBorder().paintBorder(b, g, tr.x, tr.y, tr.width, tr.height); b.setBorder(null); }
  public void paint(Graphics g, JComponent c)  {    JLabel b = (JLabel) c;    Font saved_font = g.getFont();    Rectangle tr = new Rectangle();    Rectangle ir = new Rectangle();    Rectangle vr = new Rectangle();    Font f = c.getFont();    g.setFont(f);    FontMetrics fm = g.getFontMetrics(f);    vr = SwingUtilities.calculateInnerArea(c, vr);    if (vr.width < 0)      vr.width = 0;    if (vr.height < 0)      vr.height = 0;    Icon icon = (b.isEnabled()) ? b.getIcon() : b.getDisabledIcon();    String text = layoutCL(b, fm, b.getText(), icon, vr, ir, tr);        if (icon != null)      icon.paintIcon(b, g, ir.x, ir.y);    if (text != null && !text.equals(""))    {      g.setColor(b.getBackground());      if (b.isOpaque())        g.fillRect(vr.x, vr.y, vr.width, vr.height);      else    {        g.fillRect(tr.x, tr.y, tr.width, tr.height);        if (b.getBorder() != null)          b.getBorder().paintBorder(b, g, tr.x, tr.y, tr.width, tr.height);        b.setBorder(null);      }    if (b.isEnabled())      paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent());    else      paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent());    }    g.setFont(saved_font);  }