Checkboxes

Checkboxes are two-state components that are either "on" or "off," designated by a boolean true or false value that can be tested through the classes getState method. Checkboxes are usually manipulated through an action method override.

Checkboxes may be used separately or they may be grouped into a CheckBoxGroup for which only one of the checkboxes may be true at any one time.

See the Checkbox class in the java.awt package.

Example:

Panel sexPanel = new Panel ( );
Label sexLabel = new Label ( "Sex:");
CheckboxGroup sexGroup = new CheckboxGroup ( );
Checkbox female = new Checkbox ( "female", sexGroup, false );
Checkbox male = new Checkbox ( "male", sexGroup, false );