I am adapting code from here:
Value Change Listener to JTextField
EDIT 2
The following code gives me an infinite loop of dialogs when I press the up spin
The Exception says that the String you pass to Integer.parseInt(..)
is an empty string. So make sure to check ((JSpinner.DefaultEditor)spin2.getEditor()).getTextField().getText()
for null and empty before passing it to Integer.parseInt(..)
You may have a look at apache commons-io and the StringUtils class, they have quite a few good methods to ease the pain on checking for empty/blank strings