MenuContainer
, Serializable
, Accessible
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 Classes
protected class
Inner class of PopupMenu used to provide default support for accessibility.
Constructors
Creates a new popup menu with an empty name.
Creates a new popup menu with the specified name.
void
Creates the popup menu's peer.
Gets the AccessibleContext
associated with this PopupMenu
.
void
Shows the popup menu at the x, y position relative to an origin component.
add, add, addSeparator, countItems, getItem, getItemCount, insert, insert, insertSeparator, isTearOff, paramString, remove, remove, removeAll, removeNotify
addActionListener, deleteShortcut, disable, disableEvents, enable, enable, enableEvents, getActionCommand, getActionListeners, getLabel, getListeners, getShortcut, isEnabled, processActionEvent, processEvent, removeActionListener, setActionCommand, setEnabled, setLabel, setShortcut
Creates a new popup menu with an empty name.
HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.
Creates a new popup menu with the specified name.
label
- a non-null
string specifying the popup menu's label
HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.
public void addNotify()
Creates the popup menu's peer. The peer allows us to change the appearance of the popup menu without changing any of the popup menu's functionality.
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 space
x
- the x coordinate position to popup the menu
y
- the y coordinate position to popup the menu
NullPointerException
- if the parent is null
IllegalArgumentException
- if this PopupMenu
has a non-Component
parent
IllegalArgumentException
- if the origin is not in the parent's hierarchy
RuntimeException
- if the parent is not showing on screen
Gets the AccessibleContext
associated with this PopupMenu
.
getAccessibleContext
in interface Accessible
getAccessibleContext
in class Menu
AccessibleContext
of this PopupMenu
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2022, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4