Car radios and some table radios have buttons
for selecting radio stations.
Only one station is selected at a time.
When one button is pushed in the
previous one pops out.
The Swing class
works the same way.
Radio buttons must be members of a
Only one button of a button group is
selected at any time.
Here is a constructor for
(There are other constructors not discussed here; see the Java documentation.)
JRadioButton( String text, boolean selected )
text is the string that is placed next to the button.
selected is true then this button
starts out selected.
Only one button of a button group may start out as selected.
JRadioButton is a child class of
Radio buttons and
JButtons have many methods
(Thought Question: ) Does clicking on a radio button generate an action event?