| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class PopupMenu extends Menu
A class that implements a menu which can be dynamically popped up at a specified position within a component.
As the inheritance hierarchy implies, a PopupMenu
can be used anywhere a Menu
can be used.
However, if you use a PopupMenu
like a Menu
(e.g., you add it to a MenuBar
), then you cannot
call show
on that PopupMenu
.
Nested Class Summary | |
---|---|
protected class |
Inner class of PopupMenu used to provide default support for accessibility. |
Nested classes/interfaces inherited from class java.awt.Menu |
---|
Menu.AccessibleAWTMenu |
Nested classes/interfaces inherited from class java.awt.MenuItem |
---|
MenuItem.AccessibleAWTMenuItem |
Nested classes/interfaces inherited from class java.awt.MenuComponent |
---|
MenuComponent.AccessibleAWTMenuComponent |
Constructor Summary | |
---|---|
Creates a new popup menu with an empty name. |
|
Creates a new popup menu with the specified name. |
Method Summary | |
---|---|
void |
Creates the popup menu's peer. |
AccessibleContext |
Gets the AccessibleContext associated with this
PopupMenu .
|
MenuContainer |
Returns the parent container for this menu component. |
void |
Shows the popup menu at the x, y position relative to an origin component. |
Methods inherited from class java.awt.Menu |
---|
add, add, addNotify, addSeparator, countItems, getAccessibleContext, getItem, getItemCount, insert, insert, insertSeparator, isTearOff, paramString, remove, remove, removeAll, removeNotify |
Methods inherited from class java.awt.MenuItem |
---|
addActionListener, addNotify, deleteShortcut, disable, disableEvents, enable, enable, enableEvents, getAccessibleContext, getActionCommand, getActionListeners, getLabel, getListeners, getShortcut, isEnabled, paramString, processActionEvent, processEvent, removeActionListener, setActionCommand, setEnabled, setLabel, setShortcut |
Methods inherited from class java.awt.MenuComponent |
---|
dispatchEvent, getAccessibleContext, getFont, getName, getParent, getPeer, getTreeLock, paramString, postEvent, processEvent, removeNotify, setFont, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PopupMenu() throws HeadlessException
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true.public PopupMenu(String label) throws HeadlessException
label
- a non-null
string specifying
the popup menu's labelHeadlessException
- if GraphicsEnvironment.isHeadless()
returns true.Method Detail |
---|
public void addNotify()
addNotify
in class Menu
public AccessibleContext getAccessibleContext()
AccessibleContext
associated with this
PopupMenu
.
getAccessibleContext
in class Menu
AccessibleContext
of this
PopupMenu
public MenuContainer getParent()
getParent
in class MenuComponent
public void show(Component origin, int x, int y)
If this PopupMenu
is being used as a Menu
(i.e., it has a non-Component
parent),
then you cannot call this method on the PopupMenu
.
origin
- the component which defines the coordinate spacex
- the x coordinate position to popup the menuy
- the y coordinate position to popup the menu
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |