javax.swing
Class JPopupMenu

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPopupMenu
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MenuElement
Direct Known Subclasses:
BasicComboPopup

public class JPopupMenu
extends JComponent
implements Accessible, MenuElement

JPopupMenu is a container that is used to display popup menu's menu items. By default JPopupMenu is a lightweight container, however if it is the case that JPopupMenu's bounds are outside of main window, then heawyweight container will be used to display menu items. It is also possible to change JPopupMenu's default behavior and set JPopupMenu to always use heavyweight container. JPopupMenu can be displayed anywhere; it is a floating free popup menu. However before JPopupMenu is diplayed, its invoker property should be set. JPopupMenu's invoker is a component relative to which popup menu is displayed. JPopupMenu fires PopupMenuEvents to its registered listeners. Whenever JPopupMenu becomes visible on the screen then PopupMenuEvent indicating that popup menu became visible will be fired. In the case when JPopupMenu becomes invisible or cancelled without selection, then popupMenuBecomeInvisible() or popupMenuCancelled() methods of PopupMenuListeners will be invoked. JPopupMenu also fires PropertyChangeEvents when its bound properties change.In addittion to inheritted bound properties, JPopupMenu has 'visible' bound property. When JPopupMenu becomes visible/invisible on the screen it fires PropertyChangeEvents to its registered PropertyChangeListeners.

See Also:
Serialized Form

Nested Class Summary
protected  class JPopupMenu.AccessibleJPopupMenu
           
static class JPopupMenu.Separator
          This is the separator that can be used in popup menu.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  SingleSelectionModel selectionModel
          SelectionModel that keeps track of menu selection.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JPopupMenu()
          Creates a new JPopupMenu object.
JPopupMenu(String label)
          Creates a new JPopupMenu with specified label
 
Method Summary
 JMenuItem add(Action action)
          Constructs menu item associated with the specified action and adds it to the popup menu
 JMenuItem add(JMenuItem item)
          Adds given menu item to the popup menu
 JMenuItem add(String text)
          Constructs menu item with a specified label and adds it to popup menu
 void addMenuKeyListener(MenuKeyListener l)
          Adds a MenuKeyListener to the popup.
 void addPopupMenuListener(PopupMenuListener listener)
          Adds popupMenuListener to listen for PopupMenuEvents fired by the JPopupMenu
 void addSeparator()
          Adds separator to this popup menu
protected  PropertyChangeListener createActionChangeListener(JMenuItem item)
          Creates PropertyChangeListener that listens to PropertyChangeEvents occuring in the Action associated with given menu item in this popup menu.
protected  JMenuItem createActionComponent(Action action)
          Creates new menu item associated with a given action.
protected  void firePopupMenuCanceled()
          This method calls popupMenuCanceled() of popup menu's PopupMenuListeners.
protected  void firePopupMenuWillBecomeInvisible()
          This method calls popupMenuWillBecomeInvisible() of popup menu's PopupMenuListeners.
protected  void firePopupMenuWillBecomeVisible()
          This method calls popupMenuWillBecomeVisible() of popup menu's PopupMenuListeners.
 AccessibleContext getAccessibleContext()
          DOCUMENT ME!
 Component getComponent()
          Method of the MenuElement interface.
 Component getComponentAtIndex(int index)
          Deprecated. Replaced by getComponent(int)
 int getComponentIndex(Component component)
          Returns index of the specified component in the popup menu
static boolean getDefaultLightWeightPopupEnabled()
          Returns flag indicating if newly created JPopupMenu will use heavyweight or lightweight container to display its menu items
 Component getInvoker()
          Returns popup menu's invoker.
 String getLabel()
          Returns label for this popup menu
 Insets getMargin()
          Returns margin for this popup menu.
 MenuKeyListener[] getMenuKeyListeners()
          Returns array of getMenuKeyListeners that are listening to JPopupMenu.
 PopupMenuListener[] getPopupMenuListeners()
          Returns array of PopupMenuListeners that are listening to JPopupMenu
 SingleSelectionModel getSelectionModel()
          Returns selectionModel used by this popup menu to keep track of the selection.
 MenuElement[] getSubElements()
          Return subcomonents of this popup menu.
 PopupMenuUI getUI()
          This method returns the UI used to display the JPopupMenu.
 String getUIClassID()
          This method returns a name to identify which look and feel class will be the UI delegate for the menuItem.
 void insert(Action action, int index)
          Create menu item associated with the given action and inserts it into the popup menu at the specified index
 void insert(Component component, int index)
          Insert given component to the popup menu at the specified index
 boolean isBorderPainted()
          Checks if this popup menu paints its border.
 boolean isLightWeightPopupEnabled()
          Returns true if this popup menu will display its menu item in a lightweight container and false otherwise.
 boolean isPopupTrigger(MouseEvent event)
          Checks if observing mouse event should trigger popup menu to show on the screen.
 boolean isVisible()
          Return visibility of the popup menu
 void menuSelectionChanged(boolean changed)
          Method of MenuElement Interface.
 void pack()
          This methods sets popup menu's size to its' preferred size.
protected  String paramString()
          A string that describes this JPopupMenu.
 void processKeyEvent(KeyEvent event, MenuElement[] path, MenuSelectionManager manager)
          Process key events forwarded from MenuSelectionManager.
 void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager)
          Process mouse events forwarded from MenuSelectionManager.
 void remove(int index)
          Revomes component at the given index from the menu.
 void removeMenuKeyListener(MenuKeyListener l)
          Removes a MenuKeyListener from the popup.
 void removePopupMenuListener(PopupMenuListener listener)
          Removes PopupMenuListener from JPopupMenu's list of listeners
 void setBorderPainted(boolean painted)
          Sets if the border of the popup menu should be painter or not.
static void setDefaultLightWeightPopupEnabled(boolean enabled)
          Sets whether JPopupMenu should use ligthWeight container to display it menu items by default
 void setInvoker(Component component)
          Sets popup menu's invoker.
 void setLabel(String label)
          Sets label for this popup menu.
 void setLightWeightPopupEnabled(boolean enabled)
          DOCUMENT ME!
 void setLocation(int x, int y)
          Sets location of the popup menu.
 void setPopupSize(Dimension size)
          Sets size of the popup
 void setPopupSize(int width, int height)
          Sets size of the popup menu
 void setSelected(Component selected)
          Selects specified component in this popup menu.
 void setSelectionModel(SingleSelectionModel model)
          Sets selection model for this popup menu
 void setUI(PopupMenuUI ui)
          Set the "UI" property of the menu item, which is a look and feel class responsible for handling popupMenu's input events and painting it.
 void setVisible(boolean visible)
          Sets visibility property of this popup menu.
 void show(Component component, int x, int y)
          This method displays JPopupMenu on the screen at the specified location.
 void updateUI()
          This method sets this menuItem's UI to the UIManager's default for the current look and feel.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

selectionModel

protected SingleSelectionModel selectionModel
SelectionModel that keeps track of menu selection.

Constructor Detail

JPopupMenu

public JPopupMenu()
Creates a new JPopupMenu object.


JPopupMenu

public JPopupMenu(String label)
Creates a new JPopupMenu with specified label

Parameters:
label - Label for popup menu.
Method Detail

add

public JMenuItem add(JMenuItem item)
Adds given menu item to the popup menu

Parameters:
item - menu item to add to the popup menu
Returns:
menu item that was added to the popup menu

add

public JMenuItem add(String text)
Constructs menu item with a specified label and adds it to popup menu

Parameters:
text - label for the menu item to be added
Returns:
constructed menu item that was added to the popup menu

add

public JMenuItem add(Action action)
Constructs menu item associated with the specified action and adds it to the popup menu

Parameters:
action - Action for the new menu item
Returns:
menu item that was added to the menu

remove

public void remove(int index)
Revomes component at the given index from the menu.

Overrides:
remove in class Container
Parameters:
index - index of the component that will be removed in the menu

insert

public void insert(Action action,
                   int index)
Create menu item associated with the given action and inserts it into the popup menu at the specified index

Parameters:
action - Action for the new menu item
index - index in the popup menu at which to insert new menu item.

insert

public void insert(Component component,
                   int index)
Insert given component to the popup menu at the specified index

Parameters:
component - Component to insert
index - Index at which to insert given component

getDefaultLightWeightPopupEnabled

public static boolean getDefaultLightWeightPopupEnabled()
Returns flag indicating if newly created JPopupMenu will use heavyweight or lightweight container to display its menu items

Returns:
true if JPopupMenu will use lightweight container to display menu items by default, and false otherwise.

setDefaultLightWeightPopupEnabled

public static void setDefaultLightWeightPopupEnabled(boolean enabled)
Sets whether JPopupMenu should use ligthWeight container to display it menu items by default

Parameters:
enabled - true if JPopupMenu should use lightweight container for displaying its menu items, and false otherwise.

getUI

public PopupMenuUI getUI()
This method returns the UI used to display the JPopupMenu.

Returns:
The UI used to display the JPopupMenu.

setUI

public void setUI(PopupMenuUI ui)
Set the "UI" property of the menu item, which is a look and feel class responsible for handling popupMenu's input events and painting it.

Parameters:
ui - The new "UI" property

updateUI

public void updateUI()
This method sets this menuItem's UI to the UIManager's default for the current look and feel.

Overrides:
updateUI in class JComponent

getUIClassID

public String getUIClassID()
This method returns a name to identify which look and feel class will be the UI delegate for the menuItem.

Overrides:
getUIClassID in class JComponent
Returns:
The Look and Feel classID. "PopupMenuUI"
See Also:
JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

getSelectionModel

public SingleSelectionModel getSelectionModel()
Returns selectionModel used by this popup menu to keep track of the selection.

Returns:
popup menu's selection model

setSelectionModel

public void setSelectionModel(SingleSelectionModel model)
Sets selection model for this popup menu

Parameters:
model - new selection model of this popup menu

createActionComponent

protected JMenuItem createActionComponent(Action action)
Creates new menu item associated with a given action.

Parameters:
action - Action used to create new menu item
Returns:
new created menu item associated with a given action.

createActionChangeListener

protected PropertyChangeListener createActionChangeListener(JMenuItem item)
Creates PropertyChangeListener that listens to PropertyChangeEvents occuring in the Action associated with given menu item in this popup menu.

Parameters:
item - MenuItem
Returns:
The PropertyChangeListener

isLightWeightPopupEnabled

public boolean isLightWeightPopupEnabled()
Returns true if this popup menu will display its menu item in a lightweight container and false otherwise.

Returns:
true if this popup menu will display its menu items in a lightweight container and false otherwise.

setLightWeightPopupEnabled

public void setLightWeightPopupEnabled(boolean enabled)
DOCUMENT ME!

Parameters:
enabled - DOCUMENT ME!

getLabel

public String getLabel()
Returns label for this popup menu

Returns:
label for this popup menu

setLabel

public void setLabel(String label)
Sets label for this popup menu. This method fires PropertyChangeEvent when the label property is changed. Please note that most of the Look & Feel will ignore this property.

Parameters:
label - label for this popup menu

addSeparator

public void addSeparator()
Adds separator to this popup menu


addMenuKeyListener

public void addMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the popup.

Parameters:
l - - the listener to add.

removeMenuKeyListener

public void removeMenuKeyListener(MenuKeyListener l)
Removes a MenuKeyListener from the popup.

Parameters:
l - - the listener to remove.

getMenuKeyListeners

public MenuKeyListener[] getMenuKeyListeners()
Returns array of getMenuKeyListeners that are listening to JPopupMenu.

Returns:
array of getMenuKeyListeners that are listening to JPopupMenu

addPopupMenuListener

public void addPopupMenuListener(PopupMenuListener listener)
Adds popupMenuListener to listen for PopupMenuEvents fired by the JPopupMenu

Parameters:
listener - PopupMenuListener to add to JPopupMenu

removePopupMenuListener

public void removePopupMenuListener(PopupMenuListener listener)
Removes PopupMenuListener from JPopupMenu's list of listeners

Parameters:
listener - PopupMenuListener which needs to be removed

getPopupMenuListeners

public PopupMenuListener[] getPopupMenuListeners()
Returns array of PopupMenuListeners that are listening to JPopupMenu

Returns:
Array of PopupMenuListeners that are listening to JPopupMenu

firePopupMenuWillBecomeVisible

protected void firePopupMenuWillBecomeVisible()
This method calls popupMenuWillBecomeVisible() of popup menu's PopupMenuListeners. This method is invoked just before popup menu will appear on the screen.


firePopupMenuWillBecomeInvisible

protected void firePopupMenuWillBecomeInvisible()
This method calls popupMenuWillBecomeInvisible() of popup menu's PopupMenuListeners. This method is invoked just before popup menu will disappear from the screen


firePopupMenuCanceled

protected void firePopupMenuCanceled()
This method calls popupMenuCanceled() of popup menu's PopupMenuListeners. This method is invoked just before popup menu is cancelled. This happens when popup menu is closed without selecting any of its menu items. This usually happens when the top-level window is resized or moved.


pack

public void pack()
This methods sets popup menu's size to its' preferred size. If the popup menu's size is previously set it will be ignored.


isVisible

public boolean isVisible()
Return visibility of the popup menu

Overrides:
isVisible in class Component
Returns:
true if popup menu is visible on the screen and false otherwise.
See Also:
Component.setVisible(boolean)

setVisible

public void setVisible(boolean visible)
Sets visibility property of this popup menu. If the property is set to true then popup menu will be dispayed and popup menu will hide itself if visible property is set to false.

Overrides:
setVisible in class JComponent
Parameters:
visible - true if popup menu will become visible and false otherwise.
See Also:
Component.isVisible()

setLocation

public void setLocation(int x,
                        int y)
Sets location of the popup menu.

Overrides:
setLocation in class Component
Parameters:
x - X coordinate of the popup menu's location
y - Y coordinate of the popup menu's location
See Also:
Component.getLocation(), Component.setBounds(int, int, int, int)

getInvoker

public Component getInvoker()
Returns popup menu's invoker.

Returns:
popup menu's invoker

setInvoker

public void setInvoker(Component component)
Sets popup menu's invoker.

Parameters:
component - The new invoker of this popup menu

show

public void show(Component component,
                 int x,
                 int y)
This method displays JPopupMenu on the screen at the specified location. Note that x and y coordinates given to this method should be expressed in terms of the popup menus' invoker.

Parameters:
component - Invoker for this popup menu
x - x-coordinate of the popup menu relative to the specified invoker
y - y-coordiate of the popup menu relative to the specified invoker

getComponentAtIndex

public Component getComponentAtIndex(int index)
Deprecated. Replaced by getComponent(int)

Returns component located at the specified index in the popup menu

Parameters:
index - index of the component to return
Returns:
component located at the specified index in the popup menu

getComponentIndex

public int getComponentIndex(Component component)
Returns index of the specified component in the popup menu

Parameters:
component - Component to look for
Returns:
index of the specified component in the popup menu

setPopupSize

public void setPopupSize(Dimension size)
Sets size of the popup

Parameters:
size - Dimensions representing new size of the popup menu

setPopupSize

public void setPopupSize(int width,
                         int height)
Sets size of the popup menu

Parameters:
width - width for the new size
height - height for the new size

setSelected

public void setSelected(Component selected)
Selects specified component in this popup menu.

Parameters:
selected - component to select

isBorderPainted

public boolean isBorderPainted()
Checks if this popup menu paints its border.

Returns:
true if this popup menu paints its border and false otherwise.

setBorderPainted

public void setBorderPainted(boolean painted)
Sets if the border of the popup menu should be painter or not.

Parameters:
painted - true if the border should be painted and false otherwise

getMargin

public Insets getMargin()
Returns margin for this popup menu.

Returns:
margin for this popup menu.

paramString

protected String paramString()
A string that describes this JPopupMenu. Normally only used for debugging.

Overrides:
paramString in class JComponent
Returns:
A string describing this JMenuItem

processMouseEvent

public void processMouseEvent(MouseEvent event,
                              MenuElement[] path,
                              MenuSelectionManager manager)
Process mouse events forwarded from MenuSelectionManager. This method doesn't do anything. It is here to conform to the MenuElement interface.

Specified by:
processMouseEvent in interface MenuElement
Parameters:
event - event forwarded from MenuSelectionManager
path - path to the menu element from which event was generated
manager - MenuSelectionManager for the current menu hierarchy

processKeyEvent

public void processKeyEvent(KeyEvent event,
                            MenuElement[] path,
                            MenuSelectionManager manager)
Process key events forwarded from MenuSelectionManager. This method doesn't do anything. It is here to conform to the MenuElement interface.

Specified by:
processKeyEvent in interface MenuElement
Parameters:
event - event forwarded from MenuSelectionManager
path - path to the menu element from which event was generated
manager - MenuSelectionManager for the current menu hierarchy

menuSelectionChanged

public void menuSelectionChanged(boolean changed)
Method of MenuElement Interface. It is invoked when popupMenu's selection has changed

Specified by:
menuSelectionChanged in interface MenuElement
Parameters:
changed - true if this popupMenu is part of current menu hierarchy and false otherwise.

getSubElements

public MenuElement[] getSubElements()
Return subcomonents of this popup menu. This method returns only components that implement the MenuElement interface.

Specified by:
getSubElements in interface MenuElement
Returns:
array of menu items belonging to this popup menu

getComponent

public Component getComponent()
Method of the MenuElement interface. Returns reference to itself.

Specified by:
getComponent in interface MenuElement
Returns:
Returns reference to itself

isPopupTrigger

public boolean isPopupTrigger(MouseEvent event)
Checks if observing mouse event should trigger popup menu to show on the screen.

Parameters:
event - MouseEvent to check
Returns:
true if the observing mouse event is popup trigger and false otherwise

getAccessibleContext

public AccessibleContext getAccessibleContext()
DOCUMENT ME!

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
DOCUMENT ME!