void (Graphics g) { g.setColor(getForeground()); Rectangle bounds = new Rectangle(getWidth(), getHeight()); JBInsets.removeFrom(bounds, getInsets()); if (!myHideLine) { paintLine(g, bounds); int lineHeight = lineInsets.top + lineInsets.bottom + 1; bounds.y += lineHeight; bounds.height -= lineHeight; } String caption = getCaption(); if (caption != null) { bounds.x += myLabelInsets.left; bounds.width -= myLabelInsets.left + myLabelInsets.right; bounds.y += myLabelInsets.top; bounds.height -= myLabelInsets.top + myLabelInsets.bottom; Rectangle iconR = new Rectangle(); Rectangle textR = new Rectangle(); FontMetrics fm = g.getFontMetrics(); String label = layoutCompoundLabel(fm, caption, null, CENTER, LEFT, CENTER, LEFT, bounds, iconR, textR, 0); UISettings.setupAntialiasing(g); g.setColor(getTextForeground()); g.drawString(label, textR.x, textR.y + fm.getAscent()); } }