void (Graphics g) { g.setColor(getForeground()); Rectangle bounds = new Rectangle(getWidth(), getHeight()); JBInsets.removeFrom(bounds, getInsets()); String caption = getCaption(); if (caption != null) { int hGap = getHgap(); bounds.x += hGap; bounds.width -= hGap + hGap; Rectangle iconR = new Rectangle(); Rectangle textR = new Rectangle(); FontMetrics fm = g.getFontMetrics(); String label = layoutCompoundLabel(fm, caption, null, CENTER, myAlignment, CENTER, myAlignment, bounds, iconR, textR, 0); textR.y += fm.getAscent(); if (caption.equals(label)) { int y = textR.y + (int)fm.getLineMetrics(label, g).getStrikethroughOffset(); paintLinePart(g, bounds.x, textR.x, -hGap, y); paintLinePart(g, textR.x + textR.width, bounds.x + bounds.width, hGap, y); } UISettings.setupAntialiasing(g); g.setColor(getTextForeground()); g.drawString(label, textR.x, textR.y); } else { paintLine(g, bounds.x, bounds.y, bounds.width); } }