Is there any way to associate a group of JRadioButtons with a data model so it is easier to tell which button (if any) is selected?
In an ideal world, I would like to associate a group of N radiobuttons with an enum
class that has a NONE
value and one value associated with each radiobutton.
I solved my own problem, this wasn't too hard, so share and enjoy:
Is the
javax.swing.ButtonGroup
on the lines of what you're looking forhttp://java.sun.com/javase/6/docs/api/javax/swing/ButtonGroup.html