| Summary: | Swing's ButtonGroup class allows radio button grouping to ensure single selection; however, the implementation raises many question marks. You cannot retrieve a reference to the currently selected button in the group, and the class lets you select or deselect any button accessible through a reference, not just those belonging to the group. This tip describes how JButtonGroup subclasses ButtonGroup to offer a more solid implementation, while providing convenience methods that make JButtonGroup much simpler to use. (1,700 words; September 19, 2003)
|