I have a few JSpinners and they are numeric values starting at 10 and can be incremented until 99.
In my program the user has 15 points to disperse evenly across 6 skills. Every JSpinner has an EventListener to detect if its pressed, but more specifically I need to know which button was pressed so I know which action to take. They dont want to take a point off of strength and have it decrement the Total Points by 1, Instead if the Decrement is pressed it should Add 1.
What would be the best method to execute this?
(Also I am using NetBeans so a bit of the program is autoGenerated.)
Presumably you are somewhere inside a
ChangeListener‘sstateChangedmethod – take a look at ChangeEvent#getSource()Ok, your edit made my original answer pretty pointless.
Would creating your own
SpinnerModelbe a viable option?