Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle();
  public void paint(Graphics g, JComponent c)  {    JLabel b = (JLabel) c;    Rectangle tr = new Rectangle();    Rectangle ir = new Rectangle();    Rectangle vr = new Rectangle();    FontMetrics fm = g.getFontMetrics();    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(""))    {    if (b.isEnabled())      paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent());    else      paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent());    }  }