2 4 6 8 10 | publicMainFrame(){ jRadioButton2.setActionCommand('Female'); buttonGroup=newButtonGroup(); buttonGroup.add(jRadioButton2); |
As i mentioned above, we set the action command and place RadioButton inside ButtonGroup. To get the value of your choice simply using buttonGroup object.
2 4 6 8 10 | publicMainFrame(){ jRadioButton2.setActionCommand('Female'); buttonGroup=newButtonGroup(); buttonGroup.add(jRadioButton2); |
As i mentioned above, we set the action command and place RadioButton inside ButtonGroup. To get the value of your choice simply using buttonGroup object.