|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.droplets.api.MenuComponent | +--com.droplets.api.MenuItem | +--com.droplets.api.Menu
A pulldown menu that contains menu components, which may be MenuItems
,
CheckboxMenuItems
, and other Menus
(sometimes called submenus).
You add menu items to a menu directly by calling add(com.droplets.api.MenuItem)
. The menu items
appear in the order that you add them, top to bottom.
Items can only be added to a Menu
during the Window.addAllComponents()
method. Any attempt to add items to a Menu
outside this method is ignored.
Register for menu events for a Menu
by calling MenuComponent.addActionListener(com.droplets.api.event.ActionListener)
. The listener receives
ActionEvents
for
all the items in the menu, including any items contained in submenus.
Constructor Summary | |
Menu()
Constructs a new Menu. |
|
Menu(java.lang.String label)
Constructs a menu with the specified label. |
Method Summary | |
MenuItem |
add(MenuItem mi)
Adds the specified menu item to the end of this menu. |
MenuItem |
add(java.lang.String label)
Adds a menu item with the specified label to the menu and returns the created menu item. |
MenuItem |
add(java.lang.String label,
java.lang.String actionCommand)
Adds a menu item with the specified label and action command to the menu and returns the created menu item. |
void |
addSeparator()
Adds a separator line to the end of the menu. |
Methods inherited from class com.droplets.api.MenuItem |
getActionCommand, getLabel, isEnabled, setActionCommand, setEnabled, setLabel |
Methods inherited from class com.droplets.api.MenuComponent |
addActionListener, getParent, removeActionListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Menu()
public Menu(java.lang.String label)
label
- the string displayed on the menu bar for this menu.Method Detail |
public MenuItem add(MenuItem mi)
mi
- menu item to be added.public MenuItem add(java.lang.String label)
Note that this method creates a menu item that has no action command.
label
- the label for the new menu item.public MenuItem add(java.lang.String label, java.lang.String actionCommand)
label
- the label for the new menu item.actionCommand
- the action command for the new menu item.public void addSeparator()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |