O'Reilly logo

LWUIT 1.1 for Java ME Developers by Biswajit Sarkar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The RadioButton and ButtonGroup

The 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.

The ButtonGroup class

The 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required