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
JPopupMenu.ComponentListener-
JPopupMenu.WinListener-
JPopupMenu()
-
JPopupMenu(Component)
-
add(Action)
-
add(Component)
- Adds the specified component to the end of this container.
add(JMenuItem)
-
addSeparator()
-
addWindowListener(WindowListener)
-
createComponentListener(JPopupMenu)
-
createPopupListener()
-
createWinListener(JPopupMenu)
-
fireWindowActivated(WindowEvent)
-
fireWindowClosed(WindowEvent)
-
fireWindowClosing(WindowEvent)
-
fireWindowDeactivated(WindowEvent)
-
fireWindowDeiconified(WindowEvent)
-
fireWindowIconified(WindowEvent)
-
fireWindowOpened(WindowEvent)
-
getAccessibleRole()
- Get the role of this object.
getComponentAtIndex(int)
-
getComponentIndex(Component)
-
getInvoker()
-
getMargin()
- Returns the margin between the popupmenu's border and
its containees.
getRootPopupMenu()
-
getSelectionModel()
-
getUI()
- Returns the popupmenu's current UI.
getUIClassID()
-
insert(Action, int)
-
insert(Component, int)
-
isBorderPainted()
- Checks whether the border should be painted.
isOpaque()
- Checks whether the background should be painted.
isPopupMenu()
-
isVisible()
- Determines whether this component is visible.
pack()
-
paintBorder(Graphics)
- Paint the popup menu's border if BorderPainted property is true.
removeWindowListener(WindowListener)
-
setBorderPainted(boolean)
- Sets whether the border should be painted.
setInvoker(Component)
-
setLocation(int, int)
- Moves this component to a new location.
setOpaque(boolean)
- Sets whether the background should be painted.
setPopupMenu(boolean)
-
setPopupSize(Dimension)
-
setPopupSize(int, int)
-
setSelected(Component)
-
setSelectionModel(SingleSelectionModel)
-
setUI(PopupMenuUI)
- Sets the popupmenu's UI.
setVisible(boolean)
- Shows or hides this component depending on the value of parameter
b
.
show(Component, int, int)
-
updateUI()
- Gets a new UI object from the default UIFactory.
JPopupMenu
public JPopupMenu()
JPopupMenu
public JPopupMenu(Component invoker)
getUI
public PopupMenuUI getUI()
- Returns the popupmenu's current UI.
- See Also:
- setUI
setUI
public void setUI(PopupMenuUI ui)
- Sets the popupmenu's UI.
- Parameters:
- ui - the new PopupMenuUI
- See Also:
- getUI
updateUI
public void updateUI()
- Gets a new UI object from the default UIFactory.
- Overrides:
- updateUI in class JComponent
getUIClassID
public String getUIClassID()
- Returns:
- "PopupMenuUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
getSelectionModel
public SingleSelectionModel getSelectionModel()
setSelectionModel
public void setSelectionModel(SingleSelectionModel model)
add
public JMenuItem add(JMenuItem menuItem)
add
public Component add(Component c)
- Adds the specified component to the end of this container.
- Overrides:
- add in class Container
add
public JMenuItem add(Action a)
addSeparator
public void addSeparator()
insert
public void insert(Action a,
int index)
insert
public void insert(Component component,
int index)
pack
public void pack()
setVisible
public void setVisible(boolean b)
- Shows or hides this component depending on the value of parameter
b
.
- Overrides:
- setVisible in class Component
isVisible
public boolean isVisible()
- Determines whether this component is visible.
- Overrides:
- isVisible in class Component
setLocation
public void setLocation(int x,
int y)
- Moves this component to a new location.
- Overrides:
- setLocation in class Component
isPopupMenu
public boolean isPopupMenu()
setPopupMenu
public void setPopupMenu(boolean b)
getInvoker
public Component getInvoker()
setInvoker
public void setInvoker(Component invoker)
show
public void show(Component invoker,
int x,
int y)
getRootPopupMenu
public JPopupMenu getRootPopupMenu()
getComponentIndex
public int getComponentIndex(Component c)
getComponentAtIndex
public Component getComponentAtIndex(int i)
setPopupSize
public void setPopupSize(Dimension d)
setPopupSize
public void setPopupSize(int width,
int height)
setSelected
public void setSelected(Component sel)
isBorderPainted
public boolean isBorderPainted()
- Checks whether the border should be painted.
- See Also:
- setBorderPainted
setBorderPainted
public void setBorderPainted(boolean b)
- Sets whether the border should be painted.
- Parameters:
- b - if true, the border is painted.
- See Also:
- isBorderPainted
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
getMargin
public Insets getMargin()
- Returns the margin between the popupmenu's border and
its containees.
isOpaque
public boolean isOpaque()
- Checks whether the background should be painted.
Returns true by default.
- Overrides:
- isOpaque in class JComponent
setOpaque
public void setOpaque(boolean opaque)
- Sets whether the background should be painted.
- Parameters:
- opaque - if true, the background is painted.
- See Also:
- isOpaque
addWindowListener
public void addWindowListener(WindowListener w)
removeWindowListener
public void removeWindowListener(WindowListener w)
fireWindowOpened
protected void fireWindowOpened(WindowEvent event)
fireWindowClosing
protected void fireWindowClosing(WindowEvent event)
fireWindowClosed
protected void fireWindowClosed(WindowEvent event)
fireWindowIconified
protected void fireWindowIconified(WindowEvent event)
fireWindowDeiconified
protected void fireWindowDeiconified(WindowEvent event)
fireWindowActivated
protected void fireWindowActivated(WindowEvent event)
fireWindowDeactivated
protected void fireWindowDeactivated(WindowEvent event)
createPopupListener
protected WindowListener createPopupListener()
createWinListener
protected JPopupMenu.WinListener createWinListener(JPopupMenu p)
createComponentListener
protected JPopupMenu.ComponentListener createComponentListener(JPopupMenu p)
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