void (boolean top, boolean bottom) { setBorder(new CustomLineBorder(SEPARATOR_COLOR, top ? 13 : 0, 0, bottom ? 13 : 0, 0) { @Override public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Insets insets = getBorderInsets(c); int lineY = JBUI.scale(6); int lineHeight = JBUI.scale(1); g.setColor(getColor()); if (insets.top > 0) { g.fillRect(x, y + lineY, w, lineHeight); } if (insets.bottom > 0) { g.fillRect(x, y + h - lineY, w, lineHeight); } } }); }