RadioButton class is functionally similar to
CheckBox: they both extend
Button, and they both can remember their selection status. The special capability of
RadioButton is that, while working with
ButtonGroup, it supports exclusive selection within a given set. Also, once a radio button is selected, repeated clicking on it has no effect.
Since a radio button gains its special functions only when paired with a button group, let's study the
ButtonGroup class before getting into the details of a radio button.
ButtonGroup class is an
Object that acts like a logical container, and it gives a radio button its special property to ensure that, within a button group, only one radio button can ...