java.awt
Class Checkbox

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Checkbox
All Implemented Interfaces:
java.awt.image.ImageObserver

public class Checkbox
extends Component

A Checkbox object is a graphical user interface element that has a boolean state.


Field Summary
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Checkbox()
          Constructs a Checkbox with no label, no Checkbox group, and initialized to a false state.
Checkbox(String label)
          Constructs a Checkbox with the specified label, no Checkbox group, and initialized to a false state.
Checkbox(String label, CheckboxGroup group, boolean state)
          Constructs a Checkbox with the specified label, specified Checkbox group, and specified boolean state.
 
Method Summary
 void addNotify()
          Creates the peer of the Checkbox.
 CheckboxGroup getCheckboxGroup()
          Returns the checkbox group.
 String getLabel()
          Gets the label of the button.
 boolean getState()
          Returns the boolean state of the Checkbox.
protected  String paramString()
          Returns the parameter String of this Checkbox.
 void setCheckboxGroup(CheckboxGroup g)
          Sets the CheckboxGroup to the specified group.
 void setLabel(String label)
          Sets the button with the specified label.
 void setState(boolean state)
          Sets the Checkbox to the specifed boolean state.
 
Methods inherited from class java.awt.Component
action, bounds, checkImage, checkImage, createImage, createImage, deliverEvent, disable, enable, enable, getBackground, getColorModel, getFont, getFontMetrics, getForeground, getGraphics, getParent, getPeer, getToolkit, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isEnabled, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setFont, setForeground, show, show, size, toString, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Checkbox

public Checkbox()
Constructs a Checkbox with no label, no Checkbox group, and initialized to a false state.


Checkbox

public Checkbox(String label)
Constructs a Checkbox with the specified label, no Checkbox group, and initialized to a false state.

Parameters:
label - the label on the Checkbox

Checkbox

public Checkbox(String label,
                CheckboxGroup group,
                boolean state)
Constructs a Checkbox with the specified label, specified Checkbox group, and specified boolean state. If the specified CheckboxGroup is not equal to null, then this Checkbox becomes a Checkbox button. If the Checkbox becomes a button, this simply means that only one Checkbox in a CheckboxGroup may be set at a time.

Parameters:
label - the label on the Checkbox
group - the CheckboxGroup this Checkbox is in
state - is the initial state of this Checkbox
Method Detail

addNotify

public void addNotify()
Creates the peer of the Checkbox. The peer allows you to change the look of the Checkbox without changing its functionality.

Overrides:
addNotify in class Component
See Also:
Component.getPeer(), Component.removeNotify()

getLabel

public String getLabel()
Gets the label of the button.

See Also:
setLabel(java.lang.String)

setLabel

public void setLabel(String label)
Sets the button with the specified label.

Parameters:
label - the label of the button
See Also:
getLabel()

getState

public boolean getState()
Returns the boolean state of the Checkbox.

See Also:
setState(boolean)

setState

public void setState(boolean state)
Sets the Checkbox to the specifed boolean state.

Parameters:
state - the boolean state
See Also:
getState()

getCheckboxGroup

public CheckboxGroup getCheckboxGroup()
Returns the checkbox group.

See Also:
setCheckboxGroup(java.awt.CheckboxGroup)

setCheckboxGroup

public void setCheckboxGroup(CheckboxGroup g)
Sets the CheckboxGroup to the specified group.

Parameters:
g - the new CheckboxGroup
See Also:
getCheckboxGroup()

paramString

protected String paramString()
Returns the parameter String of this Checkbox.

Overrides:
paramString in class Component