All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JPopupMenu

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

public class JPopupMenu
extends JComponent
An implementation of a Popup Menu


Variable Index

 o componentListener
 o popupListener
 o popupListenerList
The lists of client listeners.
 o selectionModel
Model for the selected subcontrol
 o windowListener

Constructor Index

 o JPopupMenu()

Method Index

 o add(Component)
 o add(JMenuItem)
 o addWindowListener(WindowListener)
 o createComponentListener(JPopupMenu)
 o createPopupListener(JPopupMenu)
 o createWinListener(JPopupMenu)
 o getComponentAt(int, int)
Returns the menu subcomponent at the given coordinates in this menu's coordinate space.
 o getComponentAtIndex(int)
 o getComponentIndex(Component)
 o getInvoker()
 o getRootPopupMenu()
 o getSelectionModel()
 o getTranslatedPoint(int, int, Component, Component)
Returns the given point in the from components coordinate space translated into the to components coordinate space.
 o getUI()
Returns the popupmenu's current UI.
 o insert(Action, int)
 o insert(Component, int)
 o isBackgroundPainted()
Checks whether the background should be painted
 o isBorderPainted()
Checks whether the border should be painted.
 o isOpaque()
 o isPopupMenu()
 o isVisible()
 o pack()
 o removeWindowListener(WindowListener)
 o setBackgroundPainted(boolean)
Sets whether the background should be painted.
 o setBorderPainted(boolean)
Sets whether the border should be painted.
 o setInvoker(Component)
 o setLocation(int, int)
 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)
 o show(Component, int, int)
 o updateUI()
Gets a new UI object from the default UIFactory.

Variables

 o popupListenerList
 protected WindowListener popupListenerList
The lists of client listeners.

 o selectionModel
 protected SingleSelectionModel selectionModel
Model for the selected subcontrol

 o popupListener
 protected JPopupMenu. PopupListener popupListener
 o windowListener
 protected JPopupMenu. WinListener windowListener
 o componentListener
 protected JPopupMenu. ComponentListener componentListener

Constructors

 o JPopupMenu
 public JPopupMenu()

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 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)
Overrides:
add in class Container
 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)
Overrides:
setVisible in class Component
 o isVisible
 public boolean isVisible()
Overrides:
isVisible in class Component
 o setLocation
 public void setLocation(int x,
                         int y)
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 getComponentAt
 public Component getComponentAt(int x,
                                 int y)
Returns the menu subcomponent at the given coordinates in this menu's coordinate space.

Overrides:
getComponentAt in class Container
 o getComponentIndex
 public int getComponentIndex(Component c)
 o getComponentAtIndex
 public Component getComponentAtIndex(int i)
 o getTranslatedPoint
 public Point getTranslatedPoint(int x,
                                 int y,
                                 Component from,
                                 Component to)
Returns the given point in the from components coordinate space translated into the to components coordinate space. The from component is expected to parent the to component.

 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 isBackgroundPainted
 public boolean isBackgroundPainted()
Checks whether the background should be painted

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

Parameters:
b - if true, the background is painted.
See Also:
isBorderPainted
 o addWindowListener
 public void addWindowListener(WindowListener w)
 o removeWindowListener
 public void removeWindowListener(WindowListener w)
 o createPopupListener
 protected JPopupMenu. PopupListener createPopupListener(JPopupMenu p)
 o createWinListener
 protected JPopupMenu. WinListener createWinListener(JPopupMenu p)
 o createComponentListener
 protected JPopupMenu. ComponentListener createComponentListener(JPopupMenu p)

All Packages  Class Hierarchy  This Package  Previous  Next  Index