Java javax.swing JPopupMenu fields, constructors, methods, implement or subclass

Example usage for Java javax.swing JPopupMenu fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing JPopupMenu.

The text is from its open source code.

Subclass

javax.swing.JPopupMenu has subclasses.
Click this link to see all its subclasses.

Constructor

JPopupMenu()
Constructs a JPopupMenu without an "invoker".
JPopupMenu(String label)
Constructs a JPopupMenu with the specified title.

Method

JMenuItemadd(JMenuItem menuItem)
Appends the specified menu item to the end of this menu.
JMenuItemadd(String s)
Creates a new menu item with the specified text and appends it to the end of this menu.
JMenuItemadd(Action a)
Appends a new menu item to the end of the menu which dispatches the specified Action object.
Componentadd(String name, Component comp)
Adds the specified component to this container.
voidaddFocusListener(FocusListener l)
Adds the specified focus listener to receive focus events from this component when this component gains input focus.
voidaddKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.
voidaddMenuKeyListener(MenuKeyListener l)
Adds a MenuKeyListener to the popup menu.
voidaddPopupMenuListener(PopupMenuListener l)
Adds a PopupMenu listener.
voidaddSeparator()
Appends a new separator at the end of the menu.
voidapplyComponentOrientation(ComponentOrientation o)
Sets the ComponentOrientation property of this container and all components contained within it.
voiddoLayout()
Causes this container to lay out its components.
ComponentgetComponent(int n)
Gets the nth component in this container.
intgetComponentCount()
Gets the number of components in this panel.
Component[]getComponents()
Gets all the components in this container.
booleangetDefaultLightWeightPopupEnabled()
Gets the defaultLightWeightPopupEnabled property, which by default is true.
FontMetricsgetFontMetrics(Font font)
Gets the FontMetrics for the specified Font.
intgetHeight()
Returns the current height of this component.
ComponentgetInvoker()
Returns the component which is the 'invoker' of this popup menu.
ContainergetParent()
Gets the parent of this component.
DimensiongetPreferredSize()
If the preferredSize has been set to a non-null value just returns it.
MenuElement[]getSubElements()
Returns an array of MenuElements containing the submenu for this menu component.
voidinsert(Action a, int index)
Inserts a menu item for the specified Action object at a given position.
voidinsert(Component component, int index)
Inserts the specified component into the menu at a given position.
booleanisLightWeightPopupEnabled()
Gets the lightWeightPopupEnabled property.
booleanisShowing()
Determines whether this component is showing on screen.
booleanisVisible()
Returns true if the popup menu is visible (currently being displayed).
voidpack()
Lays out the container so that it uses the minimum space needed to display its contents.
voidremove(int pos)
Removes the component at the specified index from this popup menu.
voidremoveAll()
Removes all the components from this container.
voidremoveFocusListener(FocusListener l)
Removes the specified focus listener so that it no longer receives focus events from this component.
voidrepaint()
Repaints this component.
voidrevalidate()
Supports deferred automatic layout.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetDefaultLightWeightPopupEnabled(boolean aFlag)
Sets the default value of the lightWeightPopupEnabled property.
voidsetInvoker(Component invoker)
Sets the invoker of this popup menu -- the component in which the popup menu menu is to be displayed.
voidsetLabel(String label)
Sets the popup menu's label.
voidsetLayout(LayoutManager mgr)
Sets the layout manager for this container.
voidsetLightWeightPopupEnabled(boolean aFlag)
Sets the value of the lightWeightPopupEnabled property, which by default is true.
voidsetLocation(int x, int y)
Sets the location of the upper left corner of the popup menu using x, y coordinates.
voidsetLocation(Point p)
Moves this component to a new location.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetSize(int width, int height)
Resizes this component so that it has width width and height height .
voidsetVisible(boolean b)
Sets the visibility of the popup menu.
voidshow(Component invoker, int x, int y)
Displays the popup menu at the position x,y in the coordinate space of the component invoker.