I want to add an array of JTextFields
inside a panel with a JSpinner
but I need to repaint the panel every time the spinner's value is changed.
How can I add that 'listener' to the spinner?
I want to add an array of JTextFields
inside a panel with a JSpinner
but I need to repaint the panel every time the spinner's value is changed.
How can I add that 'listener' to the spinner?
Start by taking a look at How to Use Spinners and the JavaDocs for
JSpinner
You could attach a
ChangeListener
to theJSpinner
usingJSpinner#addChangeListener
, which provide notifications when the model is updated