void (Graphics g) { Color separatorColor = JBUI.CurrentTheme.Popup.separatorColor(); g.setColor(separatorColor); if ("--".equals(getCaption())) { final GraphicsConfig config = GraphicsUtil.setupAAPainting(g); final int h = getHeight() / 2; LinePainter2D.paint((Graphics2D)g, 30, h, getWidth() - 30, h); ((Graphics2D)g).setPaint(new GradientPaint(5, h, ColorUtil.toAlpha(separatorColor, 0), 30, h, separatorColor)); LinePainter2D.paint((Graphics2D)g, 5, h, 30, h); ((Graphics2D)g).setPaint( new GradientPaint(getWidth() - 5, h, ColorUtil.toAlpha(separatorColor, 0), getWidth() - 30, h, separatorColor)); LinePainter2D.paint((Graphics2D)g, getWidth() - 5, h, getWidth() - 30, h); config.restore(); return; } Rectangle viewR = new Rectangle(0, getVgap(), getWidth() - 1, getHeight() - getVgap() - 1); Rectangle iconR = new Rectangle(); Rectangle textR = new Rectangle(); String s = SwingUtilities .layoutCompoundLabel(g.getFontMetrics(), getCaption(), null, CENTER, LEFT, CENTER, LEFT, viewR, iconR, textR, 0); GraphicsUtil.setupAAPainting(g); g.setColor(UIUtil.getListForeground()); g.drawString(s, textR.x + 10, textR.y + g.getFontMetrics().getAscent()); }