JSpinner (SpinnerModel sm) { JSpinner result = new JSpinner(sm); JComponent editor = result.getEditor(); if (UIUtil.isUnderWin10LookAndFeel() && editor instanceof JSpinner.DefaultEditor) { ((JSpinner.DefaultEditor)editor).getTextField().setHorizontalAlignment(SwingConstants.RIGHT); } return result; }