java.awt
public class Checkbox extends Component implements ItemSelectable, Accessible, Serializable
Nested Class Summary | |
---|---|
protected class | Checkbox.AccessibleAWTCheckbox
This class provides accessibility support for the
checkbox.
|
Constructor Summary | |
---|---|
Checkbox()
Initializes a new instance of Checkbox with no label,
an initial state of off, and that is not part of any checkbox group. | |
Checkbox(String label)
Initializes a new instance of Checkbox with the specified
label, an initial state of off, and that is not part of any checkbox
group.
| |
Checkbox(String label, boolean state)
Initializes a new instance of Checkbox with the specified
label and initial state, and that is not part of any checkbox
group.
| |
Checkbox(String label, CheckboxGroup group, boolean state)
Initializes a new instance of Checkbox with the specified
label, initial state, and checkbox group.
| |
Checkbox(String label, boolean state, CheckboxGroup group)
Initializes a new instance of Checkbox with the specified
label, initial state, and checkbox group.
|
Method Summary | |
---|---|
void | addItemListener(ItemListener listener)
Adds a new listeners to the list of registered listeners for this object.
|
void | addNotify()
Creates this object's native peer. |
AccessibleContext | getAccessibleContext()
Gets the AccessibleContext associated with this Checkbox .
|
CheckboxGroup | getCheckboxGroup()
Returns the checkbox group this object is a member of, if any.
|
ItemListener[] | getItemListeners() |
String | getLabel()
Returns the label for this checkbox.
|
Object[] | getSelectedObjects()
Returns an array of length one containing the checkbox label if this
checkbox is selected. |
boolean | getState()
Returns the state of this checkbox.
|
protected String | paramString()
Returns a debugging string for this object. |
protected void | processEvent(AWTEvent event)
Processes this event by calling processItemEvent() if it
is any instance of ItemEvent . |
protected void | processItemEvent(ItemEvent event)
Processes this event by dispatching it to any registered listeners.
|
void | removeItemListener(ItemListener listener)
Removes a listener from the list of registered listeners for this object.
|
void | setCheckboxGroup(CheckboxGroup group)
Sets this object's checkbox group to the specified group.
|
void | setLabel(String label)
Sets the label for this checkbox to the specified value.
|
void | setState(boolean state)
Sets the state of this checkbox to the specified value.
|
Checkbox
with no label,
an initial state of off, and that is not part of any checkbox group.Checkbox
with the specified
label, an initial state of off, and that is not part of any checkbox
group.
Parameters: label The label for this checkbox.
Checkbox
with the specified
label and initial state, and that is not part of any checkbox
group.
Parameters: label The label for this checkbox. state The initial state of the checkbox, true
for
on, false
for off.
Checkbox
with the specified
label, initial state, and checkbox group.
Parameters: label The label for this checkbox. group The checkbox group for this box, or null
if there is no checkbox group. state The initial state of the checkbox, true
for
on, false
for off.
Checkbox
with the specified
label, initial state, and checkbox group.
Parameters: label The label for this checkbox. state The initial state of the checkbox, true
for
on, false
for off. group The checkbox group for this box, or null
if there is no checkbox group.
Parameters: listener The new listener to add.
Checkbox
.
The context is created, if necessary.
Returns: the associated context
Returns: This object's checkbox group, of null
if it is
not a member of any group.
Returns: The label for this checkbox.
null
is returned.
Returns: The selection state of this checkbox.
Returns: The state of this checkbox, which will be true
for
on and false
for off.
processItemEvent()
if it
is any instance of ItemEvent
. Otherwise it is passed to
the superclass for processing.
Parameters: event The event to process.
Parameters: event The ItemEvent
to process.
Parameters: listener The listener to remove.
Parameters: group The new checkbox group, or null
to make this
object part of no checkbox group.
Parameters: label The new checkbox label.
Parameters: state The new state of the checkbox, which will be true
for on or false
for off.