Take JSpinner back to the last valid value on loss of focus

176 Views Asked by At

How can I make the JSpinner go back to the last valid value when it loses focus and also when I press the spinner arrow button?

1

There are 1 best solutions below

4
On

You could use an InputVerifier or adjust the spinner model to provide min/max values. See How to use Spinners