java.lang.Object | +--java.awt.MenuComponent | +--java.awt.MenuItem | +--java.awt.Menu
A
Menu object is a pull-down menu component
that is deployed from a menu bar.
A menu can optionally be a tear-off 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.
Each item in a menu must belong to the MenuItem
class. It can be an instance of MenuItem, a submenu
(an instance of Menu), or a check box (an instance of
CheckboxMenuItem).
MenuItem,
CheckboxMenuItem, Serialized Form
| Inner Class Summary | |
protected class |
Menu.AccessibleAWTMenu
Menu.AccessibleAWTMenu
|
| Inner classes inherited from class java.awt.MenuItem |
MenuItem.AccessibleAWTMenuItem |
| Inner classes inherited from class java.awt.MenuComponent |
MenuComponent.AccessibleAWTMenuComponent |
| Constructor Summary | |
Menu
copy-> new Menu()copy-> <Menu var> = new Menu();
|
|
Menu
copy-> new Menu( )copy-> <Menu var> = new Menu(<String label>);
|
|
Menu
copy-> new Menu(, )copy-> <Menu var> = new Menu(<String label>, <boolean tearOff>);
|
|
| Method Summary | |
MenuItem |
add(MenuItem mi)
copy-> .add( )copy-> <MenuItem var>=<Menu>.add(<MenuItem mi>);
|
void |
add(String label)
copy-> .add( )copy-> <Menu>.add(<String label>);
|
void |
addNotify()
copy-> .addNotify()copy-> <Menu>.addNotify(); |
void |
addSeparator()
copy-> .addSeparator()copy-> <Menu>.addSeparator();
|
int |
countItems()
copy-> .countItems()copy-> <int var>=<Menu>.countItems();
|
AccessibleContext |
getAccessibleContext()
copy-> .getAccessibleContext()copy-> <AccessibleContext var>=<Menu>.getAccessibleContext();
|
MenuItem |
getItem(int index)
copy-> .getItem( )copy-> <MenuItem var>=<Menu>.getItem(<int index>);
|
int |
getItemCount()
copy-> .getItemCount()copy-> <int var>=<Menu>.getItemCount();
|
void |
insert(MenuItem menuitem,
int index)
copy-> .insert(, )copy-> <Menu>.insert(<MenuItem menuitem>, <int index>);
|
void |
insert(String label,
int index)
copy-> .insert(, )copy-> <Menu>.insert(<String label>, <int index>);
|
void |
insertSeparator(int index)
copy-> .insertSeparator( )copy-> <Menu>.insertSeparator(<int index>);
|
boolean |
isTearOff()
copy-> .isTearOff()copy-> <boolean var>=<Menu>.isTearOff();
|
String |
paramString()
copy-> .paramString()copy-> <String var>=<Menu>.paramString();
|
void |
remove(int index)
copy-> .remove( )copy-> <Menu>.remove(<int index>);
|
void |
remove(MenuComponent item)
copy-> .remove( )copy-> <Menu>.remove(<MenuComponent item>);
|
void |
removeAll()
copy-> .removeAll()copy-> <Menu>.removeAll();
|
void |
removeNotify()
copy-> .removeNotify()copy-> <Menu>.removeNotify();
|
| Methods inherited from class java.awt.MenuItem |
addActionListener, deleteShortcut, disable, disableEvents, enable, enable, enableEvents, getActionCommand, getLabel, getListeners, getShortcut, isEnabled, processActionEvent, processEvent, removeActionListener, setActionCommand, setEnabled, setLabel, setShortcut |
| Methods inherited from class java.awt.MenuComponent |
dispatchEvent, getFont, getName, getParent, getPeer, getTreeLock, postEvent, 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 |