class org.aswing.JPopupMenu extends Container
Interfaces | |||
![]() | MenuElement |
|
An implementation of a popup menu -- a small window that pops up and displays a series of choices.
A JPopupMenu
is used for the
menu that appears when the user selects an item on the menu bar.
It is also used for "pull-right" menu that appears when the
selects a menu item that activates it. Finally, a JPopupMenu
can also be used anywhere else you want a menu to appear. For
example, when the user right-clicks in a specified area.
@author paling
Instance Fields
function addMenuItem(s:String): JMenuItem
Creates a new menu item with the specified text and appends it to the end of this menu.
s | the string for the menu item to be added |
function getRootPopupMenu(): JPopupMenu
Returns the popup menu which is at the root of the menu system for this popup menu.
returns | the topmost grandparent |
function isSelected(): Bool
Returns true if the menu bar currently has a component selected.
returns | true if a selection has been made, else false |
function isSubPopupMenu(popupMenu:JPopupMenu): Bool
Examines the list of menu items to determine whether
popupMenu
is a popup menu.
popup | a |
returns | true if |
function setSelected(sel:Component): Void
Sets the currently selected component, producing a a change to the selection model.
sel | the |
function show(invoker:Component, x:Int, y:Int): Void
Displays the popup menu at the position x,y in the coordinate space of the component invoker.
invoker | the component in whose space the popup menu is to appear |
x | the x coordinate in invoker's coordinate space at which the popup menu is to be displayed |
y | the y coordinate in invoker's coordinate space at which the popup menu is to be displayed |