<!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.CheckboxMenuItem
</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.CheckboxGroup.html#_top_">Previous</a>  <a href="java.awt.Choice.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.CheckboxMenuItem
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.awt.MenuComponent.html#_top_">java.awt.MenuComponent</a>
           |
           +----<a href="java.awt.MenuItem.html#_top_">java.awt.MenuItem</a>
                   |
                   +----java.awt.CheckboxMenuItem
</pre>
<hr>
<dl>
  <dt> public class <b>CheckboxMenuItem</b>
  <dt> extends <a href="java.awt.MenuItem.html#_top_">MenuItem</a>
  <dt> implements <a href="java.awt.ItemSelectable.html#_top_">ItemSelectable</a>
</dl>
This class represents a check box that can be included in a menu.
 Clicking on the check box in the menu changes its state from
 "on" to "off" or from "off" to "on."
 <p>
 The following picture depicts a menu which contains an instance
 of <code>CheckBoxMenuItem</code>:
 <p>
 <img src="images-awt/MenuBar-1.gif"
 ALIGN=center HSPACE=10 VSPACE=7>
 <p>
 The item labeled <code>Check</code> shows a check box menu item
 in its "off" state.
 <p>
 When a check box menu item is selected, AWT sends an item event to
 the item. Since the event is an instance of <code>ItemEvent</code>,
 the <code>processEvent</code> method examines the event and passes
 it along to <code>processItemEvent</code>. The latter method redirects
 the event to any <code>ItemListener</code> objects that have
 registered an interest in item events generated by this menu item.
<p>
<dl>
    <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>
</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="#CheckboxMenuItem()"><b>CheckboxMenuItem</b></a>()
  <dd>  Create a check box menu item with an empty label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#CheckboxMenuItem(java.lang.String)"><b>CheckboxMenuItem</b></a>(String)
  <dd>  Create a check box menu item with the specified label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#CheckboxMenuItem(java.lang.String, boolean)"><b>CheckboxMenuItem</b></a>(String, boolean)
  <dd>  Create a check box menu item with the specified label and state.
</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 menu item.
  <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 item.
  <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 menu item
 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 the state of this check box menu item
 is "on" or "off."
 
  <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 menu item.
  <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 menu item.
  <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 menu item 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 it no longer receives
 item events from this check box menu item.
  <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 this check box menu item to the specifed state.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="CheckboxMenuItem"></a>
<a name="CheckboxMenuItem()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>CheckboxMenuItem</b>
<pre>
 public CheckboxMenuItem()
</pre>
<dl>
  <dd> Create a check box menu item with an empty label.
 The item's state is initially set to "off."
<p>
</dl>
<a name="CheckboxMenuItem(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>CheckboxMenuItem</b>
<pre>
 public CheckboxMenuItem(<a href="java.lang.String.html#_top_">String</a> label)
</pre>
<dl>
  <dd> Create a check box menu item with the specified label.
 The item's state is initially set to "off."
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - a string label for the check box menu item,
                or <code>null</code> for an unlabeled menu item.
  </dl></dd>
</dl>
<a name="CheckboxMenuItem(java.lang.String, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>CheckboxMenuItem</b>
<pre>
 public CheckboxMenuItem(<a href="java.lang.String.html#_top_">String</a> label,
                         boolean state)
</pre>
<dl>
  <dd> Create a check box menu item with the specified label and state.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - the button label.
    <dd> state - the initial state of the menu item, where
                     <code>true</code> indicates "on" and
                     <code>false</code> indicates "off."
  </dl></dd>
</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 item.  This peer allows us to
 change the look of the checkbox item without changing its
 functionality.
 Most applications do not call this method directly.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.MenuItem.html#addNotify()">addNotify</a> in class <a href="java.awt.MenuItem.html#_top_">MenuItem</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.Toolkit.html#createCheckboxMenuItem(java.awt.CheckboxMenuItem)">createCheckboxMenuItem</a>, <a href="java.awt.Component.html#getToolkit()">getToolkit</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 the state of this check box menu item
 is "on" or "off."
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the state of this check box menu item, where
                     <code>true</code> indicates "on" and
                     <code>false</code> indicates "off."
    <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 synchronized void setState(boolean b)
</pre>
<dl>
  <dd> Sets this check box menu item to the specifed state.
 The boolean value <code>true</code> indicates "on" while
 <code>false</code> indicates "off."
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the boolean state of this
                      check box menu item.
    <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 synchronized <a href="java.lang.Object.html#_top_">Object</a>[] getSelectedObjects()
</pre>
<dl>
  <dd> Returns the an array (length 1) containing the checkbox menu item
 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="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 menu item.
<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="java.awt.Choice.html#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 it no longer receives
 item events from this check box menu item.
<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="java.awt.Choice.html#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 menu item.
 If the event is an instance of <code>ItemEvent</code>,
 this method invokes the <code>processItemEvent</code> method.
 If the event is not an item event,
 it invokes <code>processEvent</code> on the superclass.
 <p>
 Check box menu items currently support only item events.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> e - the event
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.MenuItem.html#processEvent(java.awt.AWTEvent)">processEvent</a> in class <a href="java.awt.MenuItem.html#_top_">MenuItem</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 menu item by
 dispatching them to any registered <code>ItemListener</code> objects.
 <p>
 This method is not called unless item events are
 enabled for this menu item. 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.MenuItem.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>
 public <a href="java.lang.String.html#_top_">String</a> paramString()
</pre>
<dl>
  <dd> Returns the parameter string representing the state of this check
 box menu item. This string is useful for debugging.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the parameter string of this check box menu item.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.MenuItem.html#paramString()">paramString</a> in class <a href="java.awt.MenuItem.html#_top_">MenuItem</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.CheckboxGroup.html#_top_">Previous</a>  <a href="java.awt.Choice.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
