/Win95NT/JDK 1.1.4/JDK 1.1.4 Documentation/api/java.awt.MenuBar.html
HTML | 326 lines | 324 code | 0 blank | 2 comment | 0 complexity | a3bde1dd71de38b1a659a93b1491462c MD5 | raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
- <!--NewPage-->
- <html>
- <head>
- <!-- Generated by javadoc on Sat Aug 30 15:44:46 PDT 1997 -->
- <title>
- Class java.awt.MenuBar
- </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.Menu.html#_top_">Previous</a> <a href="java.awt.MenuComponent.html#_top_">Next</a> <a href="a-names.html">Index</a></pre>
- <hr>
- <h1>
- Class java.awt.MenuBar
- </h1>
- <pre>
- <a href="java.lang.Object.html#_top_">java.lang.Object</a>
- |
- +----<a href="java.awt.MenuComponent.html#_top_">java.awt.MenuComponent</a>
- |
- +----java.awt.MenuBar
- </pre>
- <hr>
- <dl>
- <dt> public class <b>MenuBar</b>
- <dt> extends <a href="java.awt.MenuComponent.html#_top_">MenuComponent</a>
- <dt> implements <a href="java.awt.MenuContainer.html#_top_">MenuContainer</a>
- </dl>
- The <code>MenuBar</code> class encapsulates the platform's
- concept of a menu bar bound to a frame. In order to associate
- the menu bar with a <code>Frame</code> object, call the
- frame's <code>setMenuBar</code> method.
- <p>
- <A NAME="mbexample"></A><!-- target for cross references -->
- This is what a menu bar might look like:
- <p>
- <img src="images-awt/MenuBar-1.gif"
- ALIGN=center HSPACE=10 VSPACE=7>
- <p>
- A menu bar handles keyboard shortcuts for menu items, passing them
- along to its child menus.
- (Keyboard shortcuts, which are optional, provide the user with
- an alternative to the mouse for invoking a menu item and the
- action that is associated with it.)
- Each menu item can maintain an instance of <code>MenuShortcut</code>.
- The <code>MenuBar</code> class defines several methods,
- <A HREF="#shortcuts"><code>shortCuts</code></A> and
- <A HREF="#getShortcutMenuItem"><code>getShortcutMenuItem</code></A>
- that retrieve information about the shortcuts a given
- menu bar is managing.
- <p>
- <dl>
- <dt> <b>See Also:</b>
- <dd> <a href="java.awt.Frame.html#_top_">Frame</a>, <a href="java.awt.Frame.html#setMenuBar(java.awt.MenuBar)">setMenuBar</a>, <a href="java.awt.Menu.html#_top_">Menu</a>, <a href="java.awt.MenuItem.html#_top_">MenuItem</a>, <a href="java.awt.MenuShortcut.html#_top_">MenuShortcut</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="#MenuBar()"><b>MenuBar</b></a>()
- <dd> Creates a new menu bar.
- </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.Menu)"><b>add</b></a>(Menu)
- <dd> Adds the specified menu to the menu bar.
- <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 bar's peer.
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#countMenus()"><b>countMenus</b></a>()
- <dd>
- <b>Deprecated.</b>
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#deleteShortcut(java.awt.MenuShortcut)"><b>deleteShortcut</b></a>(MenuShortcut)
- <dd> Deletes the specified menu shortcut.
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#getHelpMenu()"><b>getHelpMenu</b></a>()
- <dd> Gets the help menu on the menu bar.
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#getMenu(int)"><b>getMenu</b></a>(int)
- <dd> Gets the specified menu.
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#getMenuCount()"><b>getMenuCount</b></a>()
- <dd> Gets the number of menus on the menu bar.
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#getShortcutMenuItem(java.awt.MenuShortcut)"><b>getShortcutMenuItem</b></a>(MenuShortcut)
- <dd> Gets the instance of <code>MenuItem</code> associated
- with the specified <code>MenuShortcut</code> object,
- or <code>null</code> if none has been specified.
- <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 located at the specified
- index from this menu bar.
- <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 component from this menu bar.
- <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 bar's peer.
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#setHelpMenu(java.awt.Menu)"><b>setHelpMenu</b></a>(Menu)
- <dd> Sets the help menu on this menu bar to be the specified menu.
- <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
- <a href="#shortcuts()"><b>shortcuts</b></a>()
- <dd>
- Gets an enumeration of all menu shortcuts this menu bar
- is managing.
- </dl>
- <a name="constructors"></a>
- <h2>
- <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
- </h2>
- <a name="MenuBar"></a>
- <a name="MenuBar()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
- <b>MenuBar</b>
- <pre>
- public MenuBar()
- </pre>
- <dl>
- <dd> Creates a new menu bar.
- <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 menu bar's peer. The peer allows us to change the
- appearance of the menu bar without changing any of the menu bar's
- functionality.
- <p>
- </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 bar's peer. The peer allows us to change the
- appearance of the menu bar without changing any of the menu bar's
- 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="getHelpMenu()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="getHelpMenu"><b>getHelpMenu</b></a>
- <pre>
- public <a href="java.awt.Menu.html#_top_">Menu</a> getHelpMenu()
- </pre>
- <dl>
- <dd> Gets the help menu on the menu bar.
- <p>
- <dd><dl>
- <dt> <b>Returns:</b>
- <dd> the help menu on this menu bar.
- </dl></dd>
- </dl>
- <a name="setHelpMenu(java.awt.Menu)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="setHelpMenu"><b>setHelpMenu</b></a>
- <pre>
- public synchronized void setHelpMenu(<a href="java.awt.Menu.html#_top_">Menu</a> m)
- </pre>
- <dl>
- <dd> Sets the help menu on this menu bar to be the specified menu.
- <p>
- <dd><dl>
- <dt> <b>Parameters:</b>
- <dd> m - the menu to be set as the help menu.
- </dl></dd>
- </dl>
- <a name="add(java.awt.Menu)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="add"><b>add</b></a>
- <pre>
- public synchronized <a href="java.awt.Menu.html#_top_">Menu</a> add(<a href="java.awt.Menu.html#_top_">Menu</a> m)
- </pre>
- <dl>
- <dd> Adds the specified menu to the menu bar.
- <p>
- <dd><dl>
- <dt> <b>Parameters:</b>
- <dd> m - the menu to be added.
- <dt> <b>Returns:</b>
- <dd> the menu added.
- <dt> <b>See Also:</b>
- <dd> <a href="#remove(int)">remove</a>, <a href="#remove(java.awt.MenuComponent)">remove</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 synchronized void remove(int index)
- </pre>
- <dl>
- <dd> Removes the menu located at the specified
- index from this menu bar.
- <p>
- <dd><dl>
- <dt> <b>Parameters:</b>
- <dd> index - the position of the menu to be removed.
- <dt> <b>See Also:</b>
- <dd> <a href="#add(java.awt.Menu)">add</a>
- </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 synchronized void remove(<a href="java.awt.MenuComponent.html#_top_">MenuComponent</a> m)
- </pre>
- <dl>
- <dd> Removes the specified menu component from this menu bar.
- <p>
- <dd><dl>
- <dt> <b>Parameters:</b>
- <dd> m - the menu component to be removed.
- <dt> <b>See Also:</b>
- <dd> <a href="#add(java.awt.Menu)">add</a>
- </dl></dd>
- </dl>
- <a name="getMenuCount()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="getMenuCount"><b>getMenuCount</b></a>
- <pre>
- public int getMenuCount()
- </pre>
- <dl>
- <dd> Gets the number of menus on the menu bar.
- <p>
- <dd><dl>
- <dt> <b>Returns:</b>
- <dd> the number of menus on the menu bar.
- </dl></dd>
- </dl>
- <a name="countMenus()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="countMenus"><b>countMenus</b></a>
- <pre>
- public int countMenus()
- </pre>
- <dl>
- <dd><b> Note: countMenus() is deprecated.</b>
- <i>As of JDK version 1.1,
- replaced by <code>getMenuCount()</code>.</i>
- <p>
- </dl>
- <a name="getMenu(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="getMenu"><b>getMenu</b></a>
- <pre>
- public <a href="java.awt.Menu.html#_top_">Menu</a> getMenu(int i)
- </pre>
- <dl>
- <dd> Gets the specified menu.
- <p>
- <dd><dl>
- <dt> <b>Parameters:</b>
- <dd> i - the index position of the menu to be returned.
- <dt> <b>Returns:</b>
- <dd> the menu at the specified index of this menu bar.
- </dl></dd>
- </dl>
- <a name="shortcuts()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="shortcuts"><b>shortcuts</b></a>
- <pre>
- public synchronized <a href="java.util.Enumeration.html#_top_">Enumeration</a> shortcuts()
- </pre>
- <dl>
- <dd> Gets an enumeration of all menu shortcuts this menu bar
- is managing.
- <p>
- <dd><dl>
- <dt> <b>Returns:</b>
- <dd> an enumeration of menu shortcuts that this
- menu bar is managing.
- <dt> <b>See Also:</b>
- <dd> <a href="java.awt.MenuShortcut.html#_top_">MenuShortcut</a>
- </dl></dd>
- </dl>
- <a name="getShortcutMenuItem(java.awt.MenuShortcut)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="getShortcutMenuItem"><b>getShortcutMenuItem</b></a>
- <pre>
- public <a href="java.awt.MenuItem.html#_top_">MenuItem</a> getShortcutMenuItem(<a href="java.awt.MenuShortcut.html#_top_">MenuShortcut</a> s)
- </pre>
- <dl>
- <dd> Gets the instance of <code>MenuItem</code> associated
- with the specified <code>MenuShortcut</code> object,
- or <code>null</code> if none has been specified.
- <p>
- <dd><dl>
- <dt> <b>Parameters:</b>
- <dd> s - the specified menu shortcut.
- <dt> <b>See Also:</b>
- <dd> <a href="java.awt.MenuItem.html#_top_">MenuItem</a>, <a href="java.awt.MenuShortcut.html#_top_">MenuShortcut</a>
- </dl></dd>
- </dl>
- <a name="deleteShortcut(java.awt.MenuShortcut)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
- <a name="deleteShortcut"><b>deleteShortcut</b></a>
- <pre>
- public void deleteShortcut(<a href="java.awt.MenuShortcut.html#_top_">MenuShortcut</a> s)
- </pre>
- <dl>
- <dd> Deletes the specified menu shortcut.
- <p>
- <dd><dl>
- <dt> <b>Parameters:</b>
- <dd> s - the menu shortcut to delete.
- </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.Menu.html#_top_">Previous</a> <a href="java.awt.MenuComponent.html#_top_">Next</a> <a href="a-names.html">Index</a></pre>
- </body>
- </html>