Share via


Class Overview | This Package | All Packages

Constructors

Name Description
MenuItem() Constructs a new MenuItem with an empty label and no keyboard shortcut.
MenuItem(String) Constructs a new MenuItem with the specified label and no keyboard shortcut.
MenuItem(String, MenuShortcut) Create a menu item with an associated keyboard shortcut.

Methods

Name Description
addActionListener(ActionListener) Adds the specified action listener to receive action events from this menu item.
addNotify() Creates the menu item's peer.
deleteShortcut() Delete any MenuShortcut object associated with this menu item.
disable() Deprecated.
disableEvents(long) Disables event delivery to this menu item for events defined by the specified event mask parameter.
enable() Deprecated.
enable(boolean) Deprecated.
enableEvents(long) Enables event delivery to this menu item for events to be defined by the specified event mask parameter

Since event types are automatically enabled when a listener for that type is added to the menu item, this method only needs to be invoked by subclasses of MenuItem which desire to have the specified event types delivered to processEvent regardless of whether a listener is registered.

getActionCommand() Gets the command name of the action event that is fired by this menu item.
getLabel() Gets the label for this menu item.
getShortcut() Get the MenuShortcut object associated with this menu item,
isEnabled() Checks whether this menu item is enabled.
paramString() Returns the parameter string representing the state of this menu item.
processActionEvent(ActionEvent) Processes action events occurring on this menu item, by dispatching them to any registered ActionListener objects.
processEvent(AWTEvent) Processes events on this menu item.
removeActionListener(ActionListener) Removes the specified action listener so it no longer receives action events from this menu item.
setActionCommand(String) Sets the command name of the action event that is fired by this menu item.
setEnabled(boolean) Sets whether or not this menu item can be chosen.
setLabel(String) Sets the label for this menu item to the specified label.
setShortcut(MenuShortcut) Set the MenuShortcut object associated with this menu item.