Help with Radio Buttons
Wondering if any of you would be able to help me.
I have a ButtonGroup with five radio buttons.
At the bottom I need to include two JButtons with up and down.
The idea is to move the selected radio buttom up and down using the JButtons at the bottom.
Any help would be really appreciated.
There are other components made for that functionality: e.g. a JSlider or a JSpinner can do the job. In your scenario the user can still click any JRadioButton she wants.
Originally Posted by miguelms19
There are many ways to acheive this functionality; for instance, why not create an ArrayList of JRadioButtons? If the up arrow has been pushed, iterate through the list finding the selected button and then selecting the previous JRadioButton in the list?
Doesn't sound like a very good design decision, but if you really need this functionality my Select Button Group class with its setSelectedIndex(int index) method might be useful to you.
Select Button Group « Java Tips Weblog