void (Graphics g) { super.paintComponent(g); if (myStrikeout){ Dimension size = getSize(); Dimension prefSize = getPreferredSize(); int width = Math.min(size.width, prefSize.width); int iconWidth = 0; Icon icon = getIcon(); if (icon != null){ iconWidth = icon.getIconWidth(); iconWidth += getIconTextGap(); } g.setColor(getForeground()); LinePainter2D.paint((Graphics2D)g, iconWidth, size.height / 2, width, size.height / 2); } }