API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. PopupMenu View Source
Author(s)
Amy Fowler
Since
Version
1.34 04/07/06
Serial
Hierarchy
 Object
      MenuComponent
          MenuItem
              Menu
                  PopupMenu
Implements
Subclasses
Description
public class PopupMenu
  A class that implements a menu which can be dynamically popped up at a specified position within a component.
See also:   
Constructors
public PopupMenu () throws HeadlessException
  Creates a new popup menu with an empty name.
public PopupMenu (String label) throws HeadlessException
  Creates a new popup menu with the specified name.
Methods
Hide/Show inherited methods
public MenuItem add (MenuItem mi) [Inherited From Menu]
  Adds the specified menu item to this menu.
public void add (String label) [Inherited From Menu]
  Adds an item with the specified label to this menu.
publicsynchronized void addActionListener (ActionListener l) [Inherited From MenuItem]
  Adds the specified action listener to receive action events from this menu item.
public void addNotify () [Overrides Menu]
  Creates the popup menu's peer.
public void addSeparator () [Inherited From Menu]
  Adds a separator line, or a hypen, to the menu at the current position.
pack-private String constructComponentName () [Overrides Menu]
  Constructs a name for this MenuComponent.
@Deprecated
public int countItems () [Inherited From Menu]
pack-privatefinal int countItemsImpl () [Inherited From Menu]
public void deleteShortcut () [Inherited From MenuItem]
  Delete any MenuShortcut object associated with this menu item.
pack-private void deleteShortcut (MenuShortcut s) [Inherited From Menu]
@Deprecated
publicsynchronized void disable () [Inherited From MenuItem]
protectedfinal void disableEvents (long eventsToDisable) [Inherited From MenuItem]
  Disables event delivery to this menu item for events defined by the specified event mask parameter.
publicfinal void dispatchEvent (AWTEvent e) [Inherited From MenuComponent]
  Delivers an event to this component or one of its sub components.
pack-private void dispatchEventImpl (AWTEvent e) [Inherited From MenuComponent]
pack-private void doMenuEvent (long when, int modifiers) [Inherited From MenuItem]
@Deprecated
publicsynchronized void enable () [Inherited From MenuItem]
@Deprecated
public void enable (boolean b) [Inherited From MenuItem]
protectedfinal void enableEvents (long eventsToEnable) [Inherited From MenuItem]
  Enables event delivery to this menu item for events to be defined by the specified event mask parameter
pack-private boolean eventEnabled (AWTEvent e) [Inherited From MenuItem]
pack-private int getAccessibleChildIndex (MenuComponent child) [Inherited From Menu]
  Defined in MenuComponent.
public AccessibleContext getAccessibleContext () [Overrides Menu]
  Gets the AccessibleContext associated with this PopupMenu.
pack-private int getAccessibleIndexInParent () [Inherited From MenuComponent]
  Gets the index of this object in its accessible parent.
pack-private AccessibleStateSet getAccessibleStateSet () [Inherited From MenuComponent]
  Gets the state of this object.
public String getActionCommand () [Inherited From MenuItem]
  Gets the command name of the action event that is fired by this menu item.
pack-privatefinal String getActionCommandImpl () [Inherited From MenuItem]
publicsynchronized ActionListener getActionListeners () [Inherited From MenuItem]
  Returns an array of all the action listeners registered on this menu item.
pack-privatefinal Font getFont_NoClientCode () [Inherited From MenuComponent]
public Font getFont () [Inherited From MenuComponent]
  Gets the font used for this menu component.
public MenuItem getItem (int index) [Inherited From Menu]
  Gets the item located at the specified index of this menu.
public int getItemCount () [Inherited From Menu]
  Get the number of items in this menu.
pack-privatefinal MenuItem getItemImpl (int index) [Inherited From Menu]
public String getLabel () [Inherited From MenuItem]
  Gets the label for this menu item.
public T getListeners (Class< T> listenerType) [Inherited From MenuItem]
  Returns an array of all the objects currently registered as FooListeners upon this MenuItem.
public String getName () [Inherited From MenuComponent]
  Gets the name of the menu component.
pack-privatefinal MenuContainer getParent_NoClientCode () [Inherited From MenuComponent]
public MenuContainer getParent () [Overrides MenuComponent]
Returns the parent container for this menu component.
@Deprecated
public MenuComponentPeer getPeer () [Inherited From MenuComponent]
public MenuShortcut getShortcut () [Inherited From MenuItem]
  Get the MenuShortcut object associated with this menu item,
pack-private MenuItem getShortcutMenuItem (MenuShortcut s) [Inherited From Menu]
protectedfinal Object getTreeLock () [Inherited From MenuComponent]
  Gets this component's locking object (the object that owns the thread sychronization monitor) for AWT component-tree and layout operations.
pack-private boolean handleShortcut (KeyEvent e) [Inherited From Menu]
public void insert (MenuItem menuitem, int index) [Inherited From Menu]
  Inserts a menu item into this menu at the specified position.
public void insert (String label, int index) [Inherited From Menu]
  Inserts a menu item with the specified label into this menu at the specified position.
public void insertSeparator (int index) [Inherited From Menu]
  Inserts a separator at the specified position.
public boolean isEnabled () [Inherited From MenuItem]
  Checks whether this menu item is enabled.
public boolean isTearOff () [Inherited From Menu]
  Indicates whether this menu is a tear-off menu.
public String paramString () [Inherited From Menu]
  Returns a string representing the state of this Menu.
@Deprecated
public boolean postEvent (Event evt) [Inherited From MenuComponent]
  Posts the specified event to the menu.
protected void processActionEvent (ActionEvent e) [Inherited From MenuItem]
  Processes action events occurring on this menu item, by dispatching them to any registered ActionListener objects.
protected void processEvent (AWTEvent e) [Inherited From MenuItem]
  Processes events on this menu item.
public void remove (int index) [Inherited From Menu]
  Removes the menu item at the specified index from this menu.
public void remove (MenuComponent item) [Inherited From Menu]
  Removes the specified menu item from this menu.
publicsynchronized void removeActionListener (ActionListener l) [Inherited From MenuItem]
  Removes the specified action listener so it no longer receives action events from this menu item.
public void removeAll () [Inherited From Menu]
  Removes all items from this menu.
public void removeNotify () [Inherited From Menu]
  Removes the menu's peer.
public void setActionCommand (String command) [Inherited From MenuItem]
  Sets the command name of the action event that is fired by this menu item.
publicsynchronized void setEnabled (boolean b) [Inherited From MenuItem]
  Sets whether or not this menu item can be chosen.
public void setFont (Font f) [Inherited From MenuComponent]
  Sets the font to be used for this menu component to the specified font.
publicsynchronized void setLabel (String label) [Inherited From MenuItem]
  Sets the label for this menu item to the specified label.
public void setName (String name) [Inherited From MenuComponent]
  Sets the name of the component to the specified string.
public void setShortcut (MenuShortcut s) [Inherited From MenuItem]
  Set the MenuShortcut object associated with this menu item.
pack-privatesynchronized Enumeration shortcuts () [Inherited From Menu]
public void show (Component origin, int x, int y)
  Shows the popup menu at the x, y position relative to an origin component.
public String toString () [Inherited From MenuComponent]
  Returns a representation of this menu component as a string.
Fields
Hide/Show inherited fields
pack-private AccessibleContext accessibleContext [Inherited From MenuComponent]
pack-private String actionCommand [Inherited From MenuItem]
  This field indicates the command tha has been issued by a particular menu item.
pack-privatetransient ActionListener actionListener [Inherited From MenuItem]
pack-privatefinalstatic String actionListenerK = "actionL" [Inherited From MenuComponent]
pack-privatetransient sun.awt.AppContext appContext [Inherited From MenuComponent]
  The AppContext of the MenuComponent.
pack-private boolean enabled [Inherited From MenuItem]
  A value to indicate whether a menu item is enabled or not.
pack-private long eventMask [Inherited From MenuItem]
  The eventMask is ONLY set by subclasses via enableEvents.
pack-private Font font [Inherited From MenuComponent]
  The menu component's font.
pack-private boolean isHelpMenu [Inherited From Menu]
  This field will be set to true if the Menu in question is actually a help menu.
pack-privatetransient boolean isTrayIconPopup
pack-privatefinalstatic String itemListenerK = "itemL" [Inherited From MenuComponent]
pack-private Vector items [Inherited From Menu]
  A vector of the items that will be part of the Menu.
pack-private String label [Inherited From MenuItem]
  label is the label of a menu item.
pack-privatestatic int nameCounter
pack-private boolean newEventsOnly [Inherited From MenuComponent]
  Defaults to false.
pack-privatetransient MenuContainer parent [Inherited From MenuComponent]
pack-privatetransient MenuComponentPeer peer [Inherited From MenuComponent]
pack-private boolean tearOff [Inherited From Menu]
  This field indicates whether the menu has the tear of property or not.
Nested Classes
  PopupMenu.AccessibleAWTPopupMenu
Inner class of PopupMenu used to provide default support for accessibility.
  Menu.AccessibleAWTMenu
Inner class of Menu used to provide default support for accessibility.
  MenuItem.AccessibleAWTMenuItem
Inner class of MenuItem used to provide default support for accessibility.
  MenuComponent.AccessibleAWTMenuComponent
Inner class of MenuComponent used to provide default support for accessibility.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar