void () { JComponent editor = spinner.getEditor(); if (editor == null) { return; } Insets i = spinner.getInsets(); Insets m = editorMargins(); int editorHeight = editor.getPreferredSize().height; int editorOffset = (spinner.getHeight() - i.top - i.bottom - m.top - m.bottom - editorHeight) / 2; editor.setBounds(i.left + m.left, i.top + m.top + editorOffset, spinner.getWidth() - (i.left + i.right + DEFAULT_ICON.getIconWidth() + m.right + m.left), editor.getPreferredSize().height); }