java::awt::CheckboxGroup Class Reference

Inheritance diagram for java::awt::CheckboxGroup:

Inheritance graph
java::lang::Object
[legend]
Collaboration diagram for java::awt::CheckboxGroup:

Collaboration graph
java::lang::Objectjava::lang::Interfacejava::lang::ObjectRefjava::lang::Syncjava::lang::Lockjava::lang::ScopeAdapterjava::lang::Comparable
[legend]

List of all members.


Detailed Description

The CheckboxGroup class is used to group together a set of Checkbox buttons.

Exactly one check box button in a CheckboxGroup can be in the "on" state at any given time. Pushing any button sets its state to "on" and forces any other button that is in the "on" state into the "off" state.

The following code example produces a new check box group, with three check boxes:


<blockquote>
 setLayout(new GridLayout(3, 1));
 CheckboxGroup cbg = new CheckboxGroup();
 add(new Checkbox("one", cbg, true));
 add(new Checkbox("two", cbg, false));
 add(new Checkbox("three", cbg, false));
 
</blockquote>

This image depicts the check box group created by this example:

CheckboxGroup-1.gif

Version:
1.34 01/23/03
Author:
Sami Shaio
See also:
java.awt.Checkbox
Since:
JDK1.0

Public Member Functions

 CheckboxGroup ()
 Creates a new instance of CheckboxGroup.
virtual Ref
< ItemCheckable
getSelectedCheckbox () const
 Gets the current choice from this check box group.
virtual void setSelectedCheckbox (const Ref< ItemCheckable > &box)
 Sets the currently selected check box in this group to be the specified check box.
virtual String toString () const
 Returns a string representation of this check box group, including the value of its current selection.

Protected Attributes

Ref< ItemCheckableselectedCheckbox
 The current choice.
Sync sync
 REGISTER_MEMBERS

Constructor & Destructor Documentation

java::awt::CheckboxGroup::CheckboxGroup (  ) 

Creates a new instance of CheckboxGroup.


Member Function Documentation

virtual Ref<ItemCheckable> java::awt::CheckboxGroup::getSelectedCheckbox (  )  const [virtual]

Gets the current choice from this check box group.

The current choice is the check box in this group that is currently in the "on" state, or null if all check boxes in the group are off.

Returns:
the check box that is currently in the "on" state, or null.
See also:
java.awt.Checkbox

java.awt.CheckboxGroup::setSelectedCheckbox

Since:
JDK1.1

virtual void java::awt::CheckboxGroup::setSelectedCheckbox ( const Ref< ItemCheckable > &  box  )  [virtual]

Sets the currently selected check box in this group to be the specified check box.

This method sets the state of that check box to "on" and sets all other check boxes in the group to be off.

If the check box argument is null, all check boxes in this check box group are deselected. If the check box argument belongs to a different check box group, this method does nothing.

Parameters:
box the Checkbox to set as the current selection.
See also:
java.awt.Checkbox

java.awt.CheckboxGroup::getSelectedCheckbox

Since:
JDK1.1

virtual String java::awt::CheckboxGroup::toString (  )  const [virtual]

Returns a string representation of this check box group, including the value of its current selection.

Returns:
a string representation of this check box group.

Reimplemented from java::lang::Object.


Member Data Documentation

Ref<ItemCheckable> java::awt::CheckboxGroup::selectedCheckbox [protected]

The current choice.

See also:
getCurrent()

setCurrent(Checkbox)

Sync java::awt::CheckboxGroup::sync [protected]

java::awt::CheckboxGroup::REGISTER_MEMBERS [protected]

Reimplemented from java::lang::Object.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:55:53 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3