Hello!
I'm creating a simple GUI which contains various elements such as JButtons (for OK and CANCEL) and JRadioButtons (for various options). The radio buttons are linked together via a ButtonGroup.
What I want to do is within the OK button listener, identify what radio button is pressed. In the button group, a button (and only one button) is always on.
I've tried this bit of code in the OK button listener (and it doesn't work! (returns a null)...
GUIInstance.radioGroup.getSelection().getActionCommand();
Can anyone help this JAVA newboy?
Cheers,
Dave.
Dave.Ring@barclays.co.uk
I'm creating a simple GUI which contains various elements such as JButtons (for OK and CANCEL) and JRadioButtons (for various options). The radio buttons are linked together via a ButtonGroup.
What I want to do is within the OK button listener, identify what radio button is pressed. In the button group, a button (and only one button) is always on.
I've tried this bit of code in the OK button listener (and it doesn't work! (returns a null)...
GUIInstance.radioGroup.getSelection().getActionCommand();
Can anyone help this JAVA newboy?
Cheers,
Dave.
Dave.Ring@barclays.co.uk