Class java.awt.MenuBar
All Packages This Package Previous Next
Class java.awt.MenuBar
java.lang.Object
|
+----java.awt.MenuComponent
|
+----java.awt.MenuBar
-
public class
MenuBar
-
extends MenuComponent
-
implements MenuContainer
A class that encapsulates the platform's concept of a menu bar bound
to a Frame. In order to associate the MenuBar with an actual Frame,
the Frame.setMenuBar() method should be called.
-
See Also:
-
setMenuBar
-
Version:
-
1.15, 09/20/95
-
Author:
-
Sami Shaio
-
MenuBar()
-
Creates a new menu bar.
-
add(Menu)
-
Adds the specified menu to the menu bar.
-
addNotify()
-
Creates the menu bar's peer.
-
countMenus()
-
Counts the number of menus on the menu bar.
-
getHelpMenu()
-
Gets the help menu on the menu bar.
-
getMenu(int)
-
Gets the specified menu.
-
remove(int)
-
Removes the menu located at the specified index from the menu bar.
-
remove(MenuComponent)
-
Removes the specified menu from the menu bar.
-
removeNotify()
-
Removes the menu bar's peer.
-
setHelpMenu(Menu)
-
Sets the help menu to the specified menu on the menu bar.
MenuBar
public MenuBar()
-
Creates a new menu bar.
addNotify
public synchronized void addNotify()
-
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.
removeNotify
public void removeNotify()
-
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.
-
Overrides:
-
removeNotify in class MenuComponent
getHelpMenu
public Menu getHelpMenu()
-
Gets the help menu on the menu bar.
setHelpMenu
public synchronized void setHelpMenu(Menu m)
-
Sets the help menu to the specified menu on the menu bar.
-
Parameters:
-
m
-
the menu to be set
add
public synchronized Menu add(Menu m)
-
Adds the specified menu to the menu bar.
-
Parameters:
-
m
-
the menu to be added to the menu bar
remove
public synchronized void remove(int index)
-
Removes the menu located at the specified index from the menu bar.
-
Parameters:
-
index
-
the position of the menu to be removed
remove
public synchronized void remove(MenuComponent m)
-
Removes the specified menu from the menu bar.
-
Parameters:
-
m
-
the menu to be removed
countMenus
public int countMenus()
-
Counts the number of menus on the menu bar.
getMenu
public Menu getMenu(int i)
-
Gets the specified menu.
-
Parameters:
-
i
-
the menu to be returned
All Packages This Package Previous Next