|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.6.0
java.awt
|
Nested Class Summary | |
---|---|
protected class |
MenuBar.AccessibleAWTMenuBar
Inner class of MenuBar used to provide default support for accessibility. |
Nested classes/interfaces inherited from class java.awt.MenuComponent |
---|
MenuComponent.AccessibleAWTMenuComponent |
Constructor Summary | |
---|---|
MenuBar()
Creates a new menu bar. |
Method Summary | |
---|---|
Menu |
add(Menu m)
Adds the specified menu to the menu bar. |
void |
addNotify()
Creates the menu bar's peer. |
int |
countMenus()
Deprecated. As of JDK version 1.1, replaced by getMenuCount() . |
void |
deleteShortcut(MenuShortcut s)
Deletes the specified menu shortcut. |
AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this MenuBar. |
Menu |
getHelpMenu()
Gets the help menu on the menu bar. |
Menu |
getMenu(int i)
Gets the specified menu. |
int |
getMenuCount()
Gets the number of menus on the menu bar. |
MenuItem |
getShortcutMenuItem(MenuShortcut s)
Gets the instance of MenuItem associated
with the specified MenuShortcut object,
or null if none of the menu items being managed
by this menu bar is associated with the specified menu
shortcut. |
void |
remove(int index)
Removes the menu located at the specified index from this menu bar. |
void |
remove(MenuComponent m)
Removes the specified menu component from this menu bar. |
void |
removeNotify()
Removes the menu bar's peer. |
void |
setHelpMenu(Menu m)
Sets the specified menu to be this menu bar's help menu. |
Enumeration<MenuShortcut> |
shortcuts()
Gets an enumeration of all menu shortcuts this menu bar is managing. |
Methods inherited from class java.awt.MenuComponent |
---|
dispatchEvent, getFont, getName, getParent, getPeer, getTreeLock, paramString, postEvent, processEvent, setFont, setName, 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 |
Constructor Detail |
---|
public MenuBar() throws HeadlessException
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true.GraphicsEnvironment.isHeadless()
Method Detail |
---|
public void addNotify()
public void removeNotify()
removeNotify
in class MenuComponent
public Menu getHelpMenu()
public void setHelpMenu(Menu m)
m
- the menu to be set as the help menupublic Menu add(Menu m)
m
- the menu to be added
remove(int)
,
remove(java.awt.MenuComponent)
public void remove(int index)
index
- the position of the menu to be removed.add(java.awt.Menu)
public void remove(MenuComponent m)
remove
in interface MenuContainer
m
- the menu component to be removed.add(java.awt.Menu)
public int getMenuCount()
@Deprecated public int countMenus()
getMenuCount()
.
public Menu getMenu(int i)
i
- the index position of the menu to be returned.
public Enumeration<MenuShortcut> shortcuts()
MenuShortcut
public MenuItem getShortcutMenuItem(MenuShortcut s)
MenuItem
associated
with the specified MenuShortcut
object,
or null
if none of the menu items being managed
by this menu bar is associated with the specified menu
shortcut.
s
- the specified menu shortcut.MenuItem
,
MenuShortcut
public void deleteShortcut(MenuShortcut s)
s
- the menu shortcut to delete.public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
getAccessibleContext
in class MenuComponent