Divider () { return new DividerImpl() { @Override public void setOrientation(boolean isVerticalSplit) { if (!isVertical()) LOG.warn("unsupported state: splitter should be vertical"); removeAll(); setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR)); JLabel label = new JLabel(myLabelText); label.setFont(UIUtil.getOptionPaneMessageFont()); label.setForeground(UIUtil.getLabelForeground()); add(label, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, JBUI.insets(2), 0, 0)); setDividerWidth(label.getPreferredSize().height + JBUIScale.scale(4)); revalidate(); repaint(); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(JBColor.border()); LinePainter2D.paint((Graphics2D)g, 0, 0, getWidth(), 0); } }; }