public class RadioButtonGroup extends EventSource
BRadioButtons
and
BRadioButtonMenuItems
. It ensures that only
one member of the group is selected at any time. It provides methods for determining which member
is currently selected, and for changing the selection.
RadioButtonGroup extends EventSource
. It generates a
SelectionChangedEvent
whenever the user changes the selected radio button. Therefore, you can simply add an event
link to a RadioButtonGroup, rather than adding one to each radio button independently.
Constructor and Description |
---|
RadioButtonGroup()
Create a new RadioButtonGroup.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getRadioButton(int i)
Get the i'th radio button in this group.
|
int |
getRadioButtonCount()
Get the number of members in this group.
|
java.util.Iterator |
getRadioButtons()
Get an Iterator listing all members of the group.
|
java.lang.Object |
getSelection()
Get the currently selected radio button, or null if none is selected.
|
void |
setSelection(java.lang.Object sel)
Select a particular radio button, and deselect all others in the group.
|
addEventLink, addEventLink, addEventLink, dispatchEvent, removeEventLink
public java.lang.Object getSelection()
public void setSelection(java.lang.Object sel)
public java.util.Iterator getRadioButtons()
public int getRadioButtonCount()
public java.lang.Object getRadioButton(int i)
Written by Peter Eastman.