|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.awt
Class MenuBar

java.lang.Objectjava.awt.MenuComponent
java.awt.MenuBar
- All Implemented Interfaces:
- javax.accessibility.Accessible, MenuContainer, java.io.Serializable
- public class MenuBar
- extends MenuComponent
- implements MenuContainer, java.io.Serializable, javax.accessibility.Accessible
- extends MenuComponent
This class implements a menu bar in the AWT system.
| Nested Class Summary | |
protected class |
MenuBar.AccessibleAWTMenuBar
This class provides accessibility support for AWT menu bars. |
| Nested classes inherited from class java.awt.MenuComponent |
MenuComponent.AccessibleAWTMenuComponent |
| Field Summary | |
private Menu |
helpMenu
|
private java.util.Vector |
menus
|
private static long |
serialVersionUID
|
| Fields inherited from class java.awt.MenuComponent |
accessibleContext, focusListener, parent, peer |
| Constructor Summary | |
MenuBar()
Initializes a new instance of MenuBar. |
|
| Method Summary | |
Menu |
add(Menu menu)
Add a menu to this MenuBar. |
void |
addNotify()
Creates this object's native peer. |
int |
countMenus()
Deprecated. This method is deprecated in favor of getMenuCount(). |
void |
deleteShortcut(MenuShortcut shortcut)
Deletes the specified menu shortcut. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this MenuBar. |
Menu |
getHelpMenu()
Returns the help menu for this menu bar. |
Menu |
getMenu(int index)
Returns the menu at the specified index. |
int |
getMenuCount()
Returns the number of elements in this menu bar. |
MenuItem |
getShortcutMenuItem(MenuShortcut shortcut)
Returns the menu item for the specified shortcut, or null
if no such item exists. |
void |
remove(int index)
Removes the menu at the specified index. |
void |
remove(MenuComponent menu)
Removes the specified menu from the menu bar. |
void |
removeNotify()
Destroys this object's native peer. |
void |
setHelpMenu(Menu menu)
Sets the help menu for this menu bar. |
java.util.Enumeration |
shortcuts()
Returns a list of all shortcuts for the menus in this menu bar. |
| Methods inherited from class java.awt.MenuComponent |
dispatchEvent, dispatchEventImpl, getFont, getName, getParent, getPeer, getToolkit, getTreeLock, paramString, postEvent, processEvent, setFont, setName, setParent, setPeer, setTreeLock, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
| Field Detail |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
helpMenu
private Menu helpMenu
menus
private java.util.Vector menus
| Constructor Detail |
MenuBar
public MenuBar()
- Initializes a new instance of
MenuBar.
| Method Detail |
getHelpMenu
public Menu getHelpMenu()
- Returns the help menu for this menu bar. This may be
null.
setHelpMenu
public void setHelpMenu(Menu menu)
- Sets the help menu for this menu bar.
add
public Menu add(Menu menu)
- Add a menu to this MenuBar. If the menu has already has a
parent, it is first removed from its old parent before being
added.
remove
public void remove(int index)
- Removes the menu at the specified index.
remove
public void remove(MenuComponent menu)
- Removes the specified menu from the menu bar.
- Specified by:
removein interfaceMenuContainer
getMenuCount
public int getMenuCount()
- Returns the number of elements in this menu bar.
countMenus
public int countMenus()
- Deprecated. This method is deprecated in favor of
getMenuCount().- Returns the number of elements in this menu bar.
- Returns the number of elements in this menu bar.
getMenu
public Menu getMenu(int index)
- Returns the menu at the specified index.
addNotify
public void addNotify()
- Creates this object's native peer.
removeNotify
public void removeNotify()
- Destroys this object's native peer.
- Overrides:
removeNotifyin classMenuComponent
shortcuts
public java.util.Enumeration shortcuts()
- Returns a list of all shortcuts for the menus in this menu bar.
getShortcutMenuItem
public MenuItem getShortcutMenuItem(MenuShortcut shortcut)
- Returns the menu item for the specified shortcut, or
nullif no such item exists.
deleteShortcut
public void deleteShortcut(MenuShortcut shortcut)
- Deletes the specified menu shortcut.
getAccessibleContext
public javax.accessibility.AccessibleContext getAccessibleContext()
- Gets the AccessibleContext associated with this
MenuBar. The context is created, if necessary.- Specified by:
getAccessibleContextin interfacejavax.accessibility.Accessible- Overrides:
getAccessibleContextin classMenuComponent
|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC