All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.JPopupMenu

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.Container
                    |
                    +----java.awt.swing.JComponent
                            |
                            +----java.awt.swing.JPopupMenu

public class JPopupMenu
extends JComponent
implements Accessible
An implementation of a Popup Menu


Class Index

 o JPopupMenu.ComponentListener
 o JPopupMenu.WinListener

Constructor Index

 o JPopupMenu()
 o JPopupMenu(Component)

Method Index

 o add(Action)
 o add(Component)
Adds the specified component to the end of this container.
 o add(JMenuItem)
 o addSeparator()
 o addWindowListener(WindowListener)
 o createComponentListener(JPopupMenu)
 o createPopupListener()
 o createWinListener(JPopupMenu)
 o fireWindowActivated(WindowEvent)
 o fireWindowClosed(WindowEvent)
 o fireWindowClosing(WindowEvent)
 o fireWindowDeactivated(WindowEvent)
 o fireWindowDeiconified(WindowEvent)
 o fireWindowIconified(WindowEvent)
 o fireWindowOpened(WindowEvent)
 o getAccessibleRole()
Get the role of this object.
 o getComponentAtIndex(int)
 o getComponentIndex(Component)
 o getInvoker()
 o getMargin()
Returns the margin between the popupmenu's border and its containees.
 o getRootPopupMenu()
 o getSelectionModel()
 o getUI()
Returns the popupmenu's current UI.
 o getUIClassID()
 o insert(Action, int)
 o insert(Component, int)
 o isBorderPainted()
Checks whether the border should be painted.
 o isOpaque()
Checks whether the background should be painted.
 o isPopupMenu()
 o isVisible()
Determines whether this component is visible.
 o pack()
 o paintBorder(Graphics)
Paint the popup menu's border if BorderPainted property is true.
 o removeWindowListener(WindowListener)
 o setBorderPainted(boolean)
Sets whether the border should be painted.
 o setInvoker(Component)
 o setLocation(int, int)
Moves this component to a new location.
 o setOpaque(boolean)
Sets whether the background should be painted.
 o setPopupMenu(boolean)
 o setPopupSize(Dimension)
 o setPopupSize(int, int)
 o setSelected(Component)
 o setSelectionModel(SingleSelectionModel)
 o setUI(PopupMenuUI)
Sets the popupmenu's UI.
 o setVisible(boolean)
Shows or hides this component depending on the value of parameter b.
 o show(Component, int, int)
 o updateUI()
Gets a new UI object from the default UIFactory.

Constructors

 o JPopupMenu
public JPopupMenu()
 o JPopupMenu
public JPopupMenu(Component invoker)

Methods

 o getUI
public PopupMenuUI getUI()
Returns the popupmenu's current UI.

See Also:
setUI
 o setUI
public void setUI(PopupMenuUI ui)
Sets the popupmenu's UI.

Parameters:
ui - the new PopupMenuUI
See Also:
getUI
 o updateUI
public void updateUI()
Gets a new UI object from the default UIFactory.

Overrides:
updateUI in class JComponent
 o getUIClassID
public String getUIClassID()
Returns:
"PopupMenuUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI
 o getSelectionModel
public SingleSelectionModel getSelectionModel()
 o setSelectionModel
public void setSelectionModel(SingleSelectionModel model)
 o add
public JMenuItem add(JMenuItem menuItem)
 o add
public Component add(Component c)
Adds the specified component to the end of this container.

Overrides:
add in class Container
 o add
public JMenuItem add(Action a)
 o addSeparator
public void addSeparator()
 o insert
public void insert(Action a,
                   int index)
 o insert
public void insert(Component component,
                   int index)
 o pack
public void pack()
 o setVisible
public void setVisible(boolean b)
Shows or hides this component depending on the value of parameter b.

Overrides:
setVisible in class Component
 o isVisible
public boolean isVisible()
Determines whether this component is visible.

Overrides:
isVisible in class Component
 o setLocation
public void setLocation(int x,
                        int y)
Moves this component to a new location.

Overrides:
setLocation in class Component
 o isPopupMenu
public boolean isPopupMenu()
 o setPopupMenu
public void setPopupMenu(boolean b)
 o getInvoker
public Component getInvoker()
 o setInvoker
public void setInvoker(Component invoker)
 o show
public void show(Component invoker,
                 int x,
                 int y)
 o getRootPopupMenu
public JPopupMenu getRootPopupMenu()
 o getComponentIndex
public int getComponentIndex(Component c)
 o getComponentAtIndex
public Component getComponentAtIndex(int i)
 o setPopupSize
public void setPopupSize(Dimension d)
 o setPopupSize
public void setPopupSize(int width,
                         int height)
 o setSelected
public void setSelected(Component sel)
 o isBorderPainted
public boolean isBorderPainted()
Checks whether the border should be painted.

See Also:
setBorderPainted
 o setBorderPainted
public void setBorderPainted(boolean b)
Sets whether the border should be painted.

Parameters:
b - if true, the border is painted.
See Also:
isBorderPainted
 o paintBorder
protected void paintBorder(Graphics g)
Paint the popup menu's border if BorderPainted property is true.

Overrides:
paintBorder in class JComponent
See Also:
paint, setBorder
 o getMargin
public Insets getMargin()
Returns the margin between the popupmenu's border and its containees.

 o isOpaque
public boolean isOpaque()
Checks whether the background should be painted. Returns true by default.

Overrides:
isOpaque in class JComponent
 o setOpaque
public void setOpaque(boolean opaque)
Sets whether the background should be painted.

Parameters:
opaque - if true, the background is painted.
See Also:
isOpaque
 o addWindowListener
public void addWindowListener(WindowListener w)
 o removeWindowListener
public void removeWindowListener(WindowListener w)
 o fireWindowOpened
protected void fireWindowOpened(WindowEvent event)
 o fireWindowClosing
protected void fireWindowClosing(WindowEvent event)
 o fireWindowClosed
protected void fireWindowClosed(WindowEvent event)
 o fireWindowIconified
protected void fireWindowIconified(WindowEvent event)
 o fireWindowDeiconified
protected void fireWindowDeiconified(WindowEvent event)
 o fireWindowActivated
protected void fireWindowActivated(WindowEvent event)
 o fireWindowDeactivated
protected void fireWindowDeactivated(WindowEvent event)
 o createPopupListener
protected WindowListener createPopupListener()
 o createWinListener
protected JPopupMenu.WinListener createWinListener(JPopupMenu p)
 o createComponentListener
protected JPopupMenu.ComponentListener createComponentListener(JPopupMenu p)
 o getAccessibleRole
public AccessibleRole getAccessibleRole()
Get the role of this object.

Returns:
an instance of AccessibleRole describing the role of the object
Overrides:
getAccessibleRole in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature