java.awt
Class PopupMenu
java.lang.Object
java.awt.MenuComponent
java.awt.MenuItem
java.awt.Menu
java.awt.PopupMenu
- All Implemented Interfaces:
- MenuContainer, Serializable, Accessible
public class PopupMenu
- extends Menu
This class implement an AWT popup menu widget
- See Also:
- Serialized Form
Constructor Summary |
PopupMenu()
Initializes a new instance of PopupMenu . |
PopupMenu(String label)
Initializes a new instance of PopupMenu with the specified
label. |
Method Summary |
void |
addNotify()
Creates this object's native peer. |
AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this PopupMenu . |
void |
show(Component component,
int x,
int y)
Displays this popup menu at the specified coordinates relative to
the specified component. |
Methods inherited from class java.awt.Menu |
add, add, addSeparator, countItems, getItem, getItemCount, insert, insert, insertSeparator, isTearOff, paramString, remove, remove, removeAll, removeNotify |
Methods inherited from class java.awt.MenuItem |
addActionListener, deleteShortcut, disable, disableEvents, enable, enable, enableEvents, getActionCommand, getActionListeners, getLabel, getListeners, getShortcut, isEnabled, processActionEvent, processEvent, removeActionListener, setActionCommand, setEnabled, setLabel, setShortcut |
PopupMenu
public PopupMenu()
- Initializes a new instance of
PopupMenu
.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless()
returns true.
PopupMenu
public PopupMenu(String label)
- Initializes a new instance of
PopupMenu
with the specified
label.
- Parameters:
label
- The label for this popup menu.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless()
returns true.
addNotify
public void addNotify()
- Creates this object's native peer.
- Overrides:
addNotify
in class Menu
show
public void show(Component component,
int x,
int y)
- Displays this popup menu at the specified coordinates relative to
the specified component.
- Parameters:
component
- The component to which the display coordinates are relative.x
- The X coordinate of the menu.y
- The Y coordinate of the menu.
getAccessibleContext
public AccessibleContext getAccessibleContext()
- Gets the AccessibleContext associated with this
PopupMenu
.
The context is created, if necessary.
- Specified by:
getAccessibleContext
in interface Accessible
- Overrides:
getAccessibleContext
in class Menu
- Returns:
- the associated context