@Override protected void paintComponent(Graphics g) { super.paintComponent(g); int count = getComponentCount() - 1; if (count > 0) { int x2 = getWidth() - JBUI.scale(16); int y = 0; g.setColor(new JBColor(0xD0D0D0, 0x717375)); for (int i = 0; i < count; i++) { Dimension size = getComponent(i).getPreferredSize(); y += size.height + 1; g.drawLine(JBUI.scale(16), y, x2, y); } } }