<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.awt.Checkbox
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.CardLayout.html#_top_">Previous</a>  <a href="java.awt.CheckboxGroup.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.Checkbox
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.awt.Component.html#_top_">java.awt.Component</a>
           |
           +----java.awt.Checkbox
</pre>
<hr>
<dl>
  <dt> public class <b>Checkbox</b>
  <dt> extends <a href="java.awt.Component.html#_top_">Component</a>
  <dt> implements <a href="java.awt.ItemSelectable.html#_top_">ItemSelectable</a>
</dl>
A check box is a graphical component that can be in either an 
 "on" (<code>true</code>) or "off" (<code>false</code>) state.
 Clicking on a check box changes its state from 
 "on" to "off," or from "off" to "on." 
 <p>
 The following code example creates a set of check boxes in
 a grid layout: 
 <p>
 <hr><blockquote><pre>
 setLayout(new GridLayout(3, 1));
 add(new Checkbox("one", null, true));
 add(new Checkbox("two"));
 add(new Checkbox("three"));
 </pre></blockquote><hr>
 <p>
 This image depicts the check boxes and grid layout
 created by this code example:
 <p>
 <img src="images-awt/Checkbox-1.gif"
 ALIGN=center HSPACE=10 VSPACE=7>
 <p>
 The button labeled <code>one</code> is in the "on" state, and the 
 other two are in the "off" state. In this example, which uses the
 <code>GridLayout</code> class, the states of the three check 
 boxes are set independently.
 <p>
 Alternatively, several check boxes can be grouped together under 
 the control of a single object, using the 
 <code>CheckboxGroup</code> class. 
 In a check box group, at most one button can be in the "on" 
 state at any given time. Clicking on a check box to turn it on
 forces any other check box in the same group that is on 
 into the "off" state.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.GridLayout.html#_top_">GridLayout</a>, <a href="java.awt.CheckboxGroup.html#_top_">CheckboxGroup</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Checkbox()"><b>Checkbox</b></a>()
  <dd>  Creates a check box with no label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Checkbox(java.lang.String)"><b>Checkbox</b></a>(String)
  <dd>  Creates a check box with the specified label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Checkbox(java.lang.String, boolean)"><b>Checkbox</b></a>(String, boolean)
  <dd>  Creates a check box with the specified label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Checkbox(java.lang.String, boolean, java.awt.CheckboxGroup)"><b>Checkbox</b></a>(String, boolean, CheckboxGroup)
  <dd>  Creates a check box with the specified label, in the specified 
 check box group, and set to the specified state.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Checkbox(java.lang.String, java.awt.CheckboxGroup, boolean)"><b>Checkbox</b></a>(String, CheckboxGroup, boolean)
  <dd>  Constructs a Checkbox with the specified label, set to the
 specified state, and in the specified check box group.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addItemListener(java.awt.event.ItemListener)"><b>addItemListener</b></a>(ItemListener)
  <dd>  Adds the specified item listener to receive item events from
 this check box.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addNotify()"><b>addNotify</b></a>()
  <dd>  Creates the peer of the Checkbox.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getCheckboxGroup()"><b>getCheckboxGroup</b></a>()
  <dd>  Determines this check box's group.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLabel()"><b>getLabel</b></a>()
  <dd>  Gets the label of this check box.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getSelectedObjects()"><b>getSelectedObjects</b></a>()
  <dd>  Returns the an array (length 1) containing the checkbox
 label or null if the checkbox is not selected.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getState()"><b>getState</b></a>()
  <dd> 
 Determines whether this check box is in the "on" or "off" state.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#paramString()"><b>paramString</b></a>()
  <dd>  Returns the parameter string representing the state of 
 this check box.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#processEvent(java.awt.AWTEvent)"><b>processEvent</b></a>(AWTEvent)
  <dd>  Processes events on this check box.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#processItemEvent(java.awt.event.ItemEvent)"><b>processItemEvent</b></a>(ItemEvent)
  <dd> 
 Processes item events occurring on this check box by
 dispatching them to any registered 
 <code>ItemListener</code> objects.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeItemListener(java.awt.event.ItemListener)"><b>removeItemListener</b></a>(ItemListener)
  <dd>  Removes the specified item listener so that the item listener 
 no longer receives item events from this check box.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setCheckboxGroup(java.awt.CheckboxGroup)"><b>setCheckboxGroup</b></a>(CheckboxGroup)
  <dd>  Sets this check box's group to be the specified check box group.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setLabel(java.lang.String)"><b>setLabel</b></a>(String)
  <dd>  Sets this check box's label to be the string argument.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setState(boolean)"><b>setState</b></a>(boolean)
  <dd> 
 Sets the state of this check box to the specified state.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Checkbox"></a>
<a name="Checkbox()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Checkbox</b>
<pre>
 public Checkbox()
</pre>
<dl>
  <dd> Creates a check box with no label. The state of this 
 check box is set to "off," and it is not part of any 
 check box group.
<p>
</dl>
<a name="Checkbox(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Checkbox</b>
<pre>
 public Checkbox(<a href="java.lang.String.html#_top_">String</a> label)
</pre>
<dl>
  <dd> Creates a check box with the specified label.  The state 
 of this check box is set to "off," and it is not part of  
 any check box group.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - a string label for this check box,
                        or <code>null</code> for no label.
  </dl></dd>
</dl>
<a name="Checkbox(java.lang.String, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Checkbox</b>
<pre>
 public Checkbox(<a href="java.lang.String.html#_top_">String</a> label,
                 boolean state)
</pre>
<dl>
  <dd> Creates a check box with the specified label.  The state 
 of this check box is as specified by the <code>state</code> 
 argument, and it is not part of any check box group.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - a string label for this check box,
                        or <code>null</code> for no label.
    <dd> state - the initial state of this check box.
  </dl></dd>
</dl>
<a name="Checkbox(java.lang.String, boolean, java.awt.CheckboxGroup)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Checkbox</b>
<pre>
 public Checkbox(<a href="java.lang.String.html#_top_">String</a> label,
                 boolean state,
                 <a href="java.awt.CheckboxGroup.html#_top_">CheckboxGroup</a> group)
</pre>
<dl>
  <dd> Creates a check box with the specified label, in the specified 
 check box group, and set to the specified state.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - a string label for this check box,
                        or <code>null</code> for no label.
    <dd> state - the initial state of this check box.
    <dd> group - a check box group for this check box,
                           or <code>null</code> for no group.
  </dl></dd>
</dl>
<a name="Checkbox(java.lang.String, java.awt.CheckboxGroup, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Checkbox</b>
<pre>
 public Checkbox(<a href="java.lang.String.html#_top_">String</a> label,
                 <a href="java.awt.CheckboxGroup.html#_top_">CheckboxGroup</a> group,
                 boolean state)
</pre>
<dl>
  <dd> Constructs a Checkbox with the specified label, set to the
 specified state, and in the specified check box group.
<p>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="addNotify()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addNotify"><b>addNotify</b></a>
<pre>
 public void addNotify()
</pre>
<dl>
  <dd> Creates the peer of the Checkbox. The peer allows you to change the
 look of the Checkbox without changing its functionality.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#addNotify()">addNotify</a> in class <a href="java.awt.Component.html#_top_">Component</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Toolkit.html#createCheckbox(java.awt.Checkbox)">createCheckbox</a>, <a href="java.awt.Component.html#getToolkit()">getToolkit</a>
  </dl></dd>
</dl>
<a name="getLabel()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLabel"><b>getLabel</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getLabel()
</pre>
<dl>
  <dd> Gets the label of this check box.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the label of this check box, or <code>null</code>
                  if this check box has no label.
    <dt> <b>See Also:</b>
    <dd> <a href="#setLabel">setLabel</a>
  </dl></dd>
</dl>
<a name="setLabel(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setLabel"><b>setLabel</b></a>
<pre>
 public synchronized void setLabel(<a href="java.lang.String.html#_top_">String</a> label)
</pre>
<dl>
  <dd> Sets this check box's label to be the string argument.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - a string to set as the new label, or
                        <code>null</code> for no label.
    <dt> <b>See Also:</b>
    <dd> <a href="#getLabel">getLabel</a>
  </dl></dd>
</dl>
<a name="getState()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getState"><b>getState</b></a>
<pre>
 public boolean getState()
</pre>
<dl>
  <dd> Determines whether this check box is in the "on" or "off" state.
 The boolean value <code>true</code> indicates the "on" state,  
 and <code>false</code> indicates the "off" state.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the state of this check box, as a boolean value.
    <dt> <b>See Also:</b>
    <dd> <a href="#setState">setState</a>
  </dl></dd>
</dl>
<a name="setState(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setState"><b>setState</b></a>
<pre>
 public void setState(boolean state)
</pre>
<dl>
  <dd> Sets the state of this check box to the specified state. 
 The boolean value <code>true</code> indicates the "on" state,  
 and <code>false</code> indicates the "off" state.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> state - the boolean state of the check box.
    <dt> <b>See Also:</b>
    <dd> <a href="#getState">getState</a>
  </dl></dd>
</dl>
<a name="getSelectedObjects()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getSelectedObjects"><b>getSelectedObjects</b></a>
<pre>
 public <a href="java.lang.Object.html#_top_">Object</a>[] getSelectedObjects()
</pre>
<dl>
  <dd> Returns the an array (length 1) containing the checkbox
 label or null if the checkbox is not selected.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.ItemSelectable.html#_top_">ItemSelectable</a>
  </dl></dd>
</dl>
<a name="getCheckboxGroup()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getCheckboxGroup"><b>getCheckboxGroup</b></a>
<pre>
 public <a href="java.awt.CheckboxGroup.html#_top_">CheckboxGroup</a> getCheckboxGroup()
</pre>
<dl>
  <dd> Determines this check box's group.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> this check box's group, or <code>null</code>
               if the check box is not part of a check box group.
    <dt> <b>See Also:</b>
    <dd> <a href="#setCheckboxGroup">setCheckboxGroup</a>
  </dl></dd>
</dl>
<a name="setCheckboxGroup(java.awt.CheckboxGroup)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setCheckboxGroup"><b>setCheckboxGroup</b></a>
<pre>
 public void setCheckboxGroup(<a href="java.awt.CheckboxGroup.html#_top_">CheckboxGroup</a> g)
</pre>
<dl>
  <dd> Sets this check box's group to be the specified check box group. 
 If this check box is already in a different check box group, 
 it is first taken out of that group.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> g - the new check box group, or <code>null</code>
                to remove this check box from any check box group.
    <dt> <b>See Also:</b>
    <dd> <a href="#getCheckboxGroup">getCheckboxGroup</a>
  </dl></dd>
</dl>
<a name="addItemListener(java.awt.event.ItemListener)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addItemListener"><b>addItemListener</b></a>
<pre>
 public synchronized void addItemListener(<a href="java.awt.event.ItemListener.html#_top_">ItemListener</a> l)
</pre>
<dl>
  <dd> Adds the specified item listener to receive item events from
 this check box.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> l - the item listener.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.event.ItemEvent.html#_top_">ItemEvent</a>, <a href="java.awt.event.ItemListener.html#_top_">ItemListener</a>, <a href="#removeItemListener">removeItemListener</a>
  </dl></dd>
</dl>
<a name="removeItemListener(java.awt.event.ItemListener)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeItemListener"><b>removeItemListener</b></a>
<pre>
 public synchronized void removeItemListener(<a href="java.awt.event.ItemListener.html#_top_">ItemListener</a> l)
</pre>
<dl>
  <dd> Removes the specified item listener so that the item listener 
 no longer receives item events from this check box.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> l - the item listener.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.event.ItemEvent.html#_top_">ItemEvent</a>, <a href="java.awt.event.ItemListener.html#_top_">ItemListener</a>, <a href="#addItemListener">addItemListener</a>
  </dl></dd>
</dl>
<a name="processEvent(java.awt.AWTEvent)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="processEvent"><b>processEvent</b></a>
<pre>
 protected void processEvent(<a href="java.awt.AWTEvent.html#_top_">AWTEvent</a> e)
</pre>
<dl>
  <dd> Processes events on this check box. 
 If the event is an instance of <code>ItemEvent</code>,
 this method invokes the <code>processItemEvent</code> method. 
 Otherwise, it calls its superclass's <code>processEvent</code> method.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> e - the event.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#processEvent(java.awt.AWTEvent)">processEvent</a> in class <a href="java.awt.Component.html#_top_">Component</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.event.ItemEvent.html#_top_">ItemEvent</a>, <a href="#processItemEvent">processItemEvent</a>
  </dl></dd>
</dl>
<a name="processItemEvent(java.awt.event.ItemEvent)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="processItemEvent"><b>processItemEvent</b></a>
<pre>
 protected void processItemEvent(<a href="java.awt.event.ItemEvent.html#_top_">ItemEvent</a> e)
</pre>
<dl>
  <dd> Processes item events occurring on this check box by
 dispatching them to any registered 
 <code>ItemListener</code> objects. 
 <p>
 This method is not called unless item events are 
 enabled for this component. Item events are enabled 
 when one of the following occurs:
 <p><ul>
 <li>An <code>ItemListener</code> object is registered 
 via <code>addItemListener</code>.
 <li>Item events are enabled via <code>enableEvents</code>.
 </ul>
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> e - the item event.
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.event.ItemEvent.html#_top_">ItemEvent</a>, <a href="java.awt.event.ItemListener.html#_top_">ItemListener</a>, <a href="#addItemListener">addItemListener</a>, <a href="java.awt.Component.html#enableEvents">enableEvents</a>
  </dl></dd>
</dl>
<a name="paramString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="paramString"><b>paramString</b></a>
<pre>
 protected <a href="java.lang.String.html#_top_">String</a> paramString()
</pre>
<dl>
  <dd> Returns the parameter string representing the state of 
 this check box. This string is useful for debugging.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the parameter string of this check box.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.Component.html#paramString()">paramString</a> in class <a href="java.awt.Component.html#_top_">Component</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.html">This Package</a>  <a href="java.awt.CardLayout.html#_top_">Previous</a>  <a href="java.awt.CheckboxGroup.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
