<!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.Menu
</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.MediaTracker.html#_top_">Previous</a>  <a href="java.awt.MenuBar.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.Menu
</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.Menu
</pre>
<hr>
<dl>
  <dt> public class <b>Menu</b>
  <dt> extends <a href="java.awt.MenuItem.html#_top_">MenuItem</a>
  <dt> implements <a href="java.awt.MenuContainer.html#_top_">MenuContainer</a>
</dl>
A <code>Menu</code> object is a pull-down menu component
 that is deployed from a menu bar.
 <p>
 A menu can optionally be a <i>tear-off</i> menu. A tear-off menu
 can be opened and dragged away from its parent menu bar or menu.
 It remains on the screen after the mouse button has been released.
 The mechanism for tearing off a menu is platform dependent, since
 the look and feel of the tear-off menu is determined by its peer.
 On platforms that do not support tear-off menus, the tear-off
 property is ignored.
 <p>
 Each item in a menu must belong to the <code>MenuItem</code>
 class. It can be an instance of <code>MenuItem</code>, a submenu
 (an instance of <code>Menu</code>), or a check box (an instance of
 <code>CheckboxMenuItem</code>).
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.MenuItem.html#_top_">MenuItem</a>, <a href="java.awt.CheckboxMenuItem.html#_top_">CheckboxMenuItem</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="#Menu()"><b>Menu</b></a>()
  <dd>  Constructs a new menu with an empty label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Menu(java.lang.String)"><b>Menu</b></a>(String)
  <dd>  Constructs a new menu with the specified label.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Menu(java.lang.String, boolean)"><b>Menu</b></a>(String, boolean)
  <dd>  Constructs a new menu with the specified label.
</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="#add(java.awt.MenuItem)"><b>add</b></a>(MenuItem)
  <dd>  Adds the specified menu item to this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#add(java.lang.String)"><b>add</b></a>(String)
  <dd>  Adds an item with the specified label to this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addNotify()"><b>addNotify</b></a>()
  <dd>  Creates the menu's peer.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addSeparator()"><b>addSeparator</b></a>()
  <dd>  Adds a separator line, or a hypen, to the menu at the current position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#countItems()"><b>countItems</b></a>()
  <dd>  
<b>Deprecated.</b>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getItem(int)"><b>getItem</b></a>(int)
  <dd>  Gets the item located at the specified index of this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getItemCount()"><b>getItemCount</b></a>()
  <dd>  Get the number of items in this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#insert(java.awt.MenuItem, int)"><b>insert</b></a>(MenuItem, int)
  <dd>  Inserts a menu item into this menu
 at the specified position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#insert(java.lang.String, int)"><b>insert</b></a>(String, int)
  <dd>  Inserts a menu item with the specified label into this menu
 at the specified position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#insertSeparator(int)"><b>insertSeparator</b></a>(int)
  <dd>  Inserts a separator at the specified position.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#isTearOff()"><b>isTearOff</b></a>()
  <dd>  Indicates whether this menu is a tear-off menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#paramString()"><b>paramString</b></a>()
  <dd>  Gets the parameter string representing the state of this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#remove(int)"><b>remove</b></a>(int)
  <dd>  Removes the menu item at the specified index from this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#remove(java.awt.MenuComponent)"><b>remove</b></a>(MenuComponent)
  <dd>  Removes the specified menu item from this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeAll()"><b>removeAll</b></a>()
  <dd>  Removes all items from this menu.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeNotify()"><b>removeNotify</b></a>()
  <dd>  Removes the menu's peer.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Menu"></a>
<a name="Menu()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Menu</b>
<pre>
 public Menu()
</pre>
<dl>
  <dd> Constructs a new menu with an empty label. This menu is not
 a tear-off menu.
<p>
</dl>
<a name="Menu(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Menu</b>
<pre>
 public Menu(<a href="java.lang.String.html#_top_">String</a> label)
</pre>
<dl>
  <dd> Constructs a new menu with the specified label. This menu is not
 a tear-off menu.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - the menu's label in the menu bar, or in
                   another menu of which this menu is a submenu.
  </dl></dd>
</dl>
<a name="Menu(java.lang.String, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Menu</b>
<pre>
 public Menu(<a href="java.lang.String.html#_top_">String</a> label,
             boolean tearOff)
</pre>
<dl>
  <dd> Constructs a new menu with the specified label. If the
 value of <code>tearOff</code> is <code>true</code>,
 the menu can be torn off.
 <p>
 Tear-off functionality may not be supported by all
 implementations of AWT.  If a particular implementation doesn't
 support tear-off menus, this value is silently ignored.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - the menu's label in the menu bar, or in
                   another menu of which this menu is a submenu.
    <dd> tearOff - if <code>true</code>, the menu
                   is a tear-off menu.
  </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 menu's peer.  The peer allows us to modify the
 appearance of the menu without changing its functionality.
<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>
  </dl></dd>
</dl>
<a name="removeNotify()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeNotify"><b>removeNotify</b></a>
<pre>
 public void removeNotify()
</pre>
<dl>
  <dd> Removes the menu's peer.  The peer allows us to modify the appearance
 of the menu without changing its functionality.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.MenuComponent.html#removeNotify()">removeNotify</a> in class <a href="java.awt.MenuComponent.html#_top_">MenuComponent</a>
  </dl></dd>
</dl>
<a name="isTearOff()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isTearOff"><b>isTearOff</b></a>
<pre>
 public boolean isTearOff()
</pre>
<dl>
  <dd> Indicates whether this menu is a tear-off menu.
 <p>
 Tear-off functionality may not be supported by all
 implementations of AWT.  If a particular implementation doesn't
 support tear-off menus, this value is silently ignored.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> <code>true</code> if this is a tear-off menu;
                         <code>false</code> otherwise.
  </dl></dd>
</dl>
<a name="getItemCount()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getItemCount"><b>getItemCount</b></a>
<pre>
 public int getItemCount()
</pre>
<dl>
  <dd> Get the number of items in this menu.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of items in this menu.
  </dl></dd>
</dl>
<a name="countItems()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="countItems"><b>countItems</b></a>
<pre>
 public int countItems()
</pre>
<dl>
<dd><b> Note: countItems() is deprecated.</b>
<i>As of JDK version 1.1,
 replaced by <code>getItemCount()</code>.</i>
<p>
</dl>
<a name="getItem(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getItem"><b>getItem</b></a>
<pre>
 public <a href="java.awt.MenuItem.html#_top_">MenuItem</a> getItem(int index)
</pre>
<dl>
  <dd> Gets the item located at the specified index of this menu.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> index - the position of the item to be returned.
    <dt> <b>Returns:</b>
    <dd> the item located at the specified index.
  </dl></dd>
</dl>
<a name="add(java.awt.MenuItem)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="add"><b>add</b></a>
<pre>
 public <a href="java.awt.MenuItem.html#_top_">MenuItem</a> add(<a href="java.awt.MenuItem.html#_top_">MenuItem</a> mi)
</pre>
<dl>
  <dd> Adds the specified menu item to this menu. If the
 menu item has been part of another menu, remove it
 from that menu.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> mi - the menu item to be added.
    <dt> <b>Returns:</b>
    <dd> the menu item added.
    <dt> <b>See Also:</b>
    <dd> <a href="#insert(java.lang.String, int)">insert</a>, <a href="#insert(java.awt.MenuItem, int)">insert</a>
  </dl></dd>
</dl>
<a name="add(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="add"><b>add</b></a>
<pre>
 public void add(<a href="java.lang.String.html#_top_">String</a> label)
</pre>
<dl>
  <dd> Adds an item with the specified label to this menu.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - the text on the item.
    <dt> <b>See Also:</b>
    <dd> <a href="#insert(java.lang.String, int)">insert</a>, <a href="#insert(java.awt.MenuItem, int)">insert</a>
  </dl></dd>
</dl>
<a name="insert(java.awt.MenuItem, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="insert"><b>insert</b></a>
<pre>
 public void insert(<a href="java.awt.MenuItem.html#_top_">MenuItem</a> menuitem,
                    int index)
</pre>
<dl>
  <dd> Inserts a menu item into this menu
 at the specified position.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> menuitem - the menu item to be inserted.
    <dd> index - the position at which the menu
                          item should be inserted.
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the value of
                    <code>index</code> is less than zero.
    <dt> <b>See Also:</b>
    <dd> <a href="#add(java.lang.String)">add</a>, <a href="#add(java.awt.MenuItem)">add</a>
  </dl></dd>
</dl>
<a name="insert(java.lang.String, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="insert"><b>insert</b></a>
<pre>
 public void insert(<a href="java.lang.String.html#_top_">String</a> label,
                    int index)
</pre>
<dl>
  <dd> Inserts a menu item with the specified label into this menu
 at the specified position.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> label - the text on the item.
    <dd> index - the position at which the menu item
                      should be inserted.
    <dt> <b>See Also:</b>
    <dd> <a href="#add(java.lang.String)">add</a>, <a href="#add(java.awt.MenuItem)">add</a>
  </dl></dd>
</dl>
<a name="addSeparator()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addSeparator"><b>addSeparator</b></a>
<pre>
 public void addSeparator()
</pre>
<dl>
  <dd> Adds a separator line, or a hypen, to the menu at the current position.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#insertSeparator(int)">insertSeparator</a>
  </dl></dd>
</dl>
<a name="insertSeparator(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="insertSeparator"><b>insertSeparator</b></a>
<pre>
 public void insertSeparator(int index)
</pre>
<dl>
  <dd> Inserts a separator at the specified position.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> index - the position at which the
                       menu separator should be inserted.
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the value of
                       <code>index</code> is less than 0.
    <dt> <b>See Also:</b>
    <dd> <a href="#addSeparator">addSeparator</a>
  </dl></dd>
</dl>
<a name="remove(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="remove"><b>remove</b></a>
<pre>
 public void remove(int index)
</pre>
<dl>
  <dd> Removes the menu item at the specified index from this menu.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> index - the position of the item to be removed.
  </dl></dd>
</dl>
<a name="remove(java.awt.MenuComponent)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="remove"><b>remove</b></a>
<pre>
 public void remove(<a href="java.awt.MenuComponent.html#_top_">MenuComponent</a> item)
</pre>
<dl>
  <dd> Removes the specified menu item from this menu.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> item - the item to be removed from the menu
  </dl></dd>
</dl>
<a name="removeAll()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeAll"><b>removeAll</b></a>
<pre>
 public void removeAll()
</pre>
<dl>
  <dd> Removes all items from this menu.
<p>
</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> Gets the parameter string representing the state of this menu.
 This string is useful for debugging.
<p>
  <dd><dl>
    <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.MediaTracker.html#_top_">Previous</a>  <a href="java.awt.MenuBar.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
