void () { int w = spinner.getWidth(); int h = spinner.getHeight(); Dimension abSize = nextButton.getPreferredSize(); nextButton.setBounds(w - abSize.width, JBUIScale.scale(1), abSize.width, h / 2); prevButton.setBounds(w - abSize.width, h / 2, abSize.width, h - h / 2); JComponent editor = spinner.getEditor(); if (editor != null) { Insets i = spinner.getInsets(); Insets m = editorMargins(); int editorHeight = editor.getPreferredSize().height; int editorOffset = (int)Math.round((h - i.top - i.bottom - m.top - m.bottom - editorHeight) / 2.0); editor.setBounds(i.left + m.left, i.top + m.top + editorOffset, w - (i.left + abSize.width + m.left + m.right), editorHeight); } }