LayoutManager () { return new LayoutManagerDelegate(super.createLayout()) { @Override public void layoutContainer(Container parent) { super.layoutContainer(parent); Rectangle bounds = parent.getBounds(); Dimension nextButtonSize = nextButton.getPreferredSize(); Dimension prevButtonSize = prevButton.getPreferredSize(); nextButtonSize.height = bounds.height * nextButtonSize.height / (nextButtonSize.height + prevButtonSize.height - JBUIScale.scale(1)); nextButton.setBounds(bounds.width - nextButtonSize.width, 0, nextButtonSize.width, nextButtonSize.height); prevButton.setBounds(bounds.width - prevButtonSize.width, nextButtonSize.height - JBUIScale.scale(1), prevButtonSize.width, bounds.height - nextButtonSize.height + JBUIScale.scale(1)); JComponent editor = spinner.getEditor(); if (editor != null) { int w = spinner.getWidth(); int h = spinner.getHeight(); Insets i = spinner.getInsets(); Insets m = editorMargins(); int editorHeight = editor.getPreferredSize().height; int editorOffset = (h - i.top - i.bottom - m.top - m.bottom - editorHeight) / 2; editor.setBounds(i.left + m.left, i.top + m.top + editorOffset, w - (i.left + m.left + JBUIScale.scale(BUTTON_WIDTH) + m.right + i.right), editorHeight); } } }; }