PopupMenu
A popup menu component.
A popup menu component.
Example usage:
val popupMenu = new PopupMenu {
contents += new Menu("menu 1") {
contents += new RadioMenuItem("radio 1.1")
contents += new RadioMenuItem("radio 1.2")
}
contents += new Menu("menu 2") {
contents += new RadioMenuItem("radio 2.1")
contents += new RadioMenuItem("radio 2.2")
}
}
val button = new Button("Show Popup Menu")
reactions += {
case e: ButtonClicked => popupMenu.show(button, 0, button.bounds.height)
}
listenTo(button)
The component publishes PopupMenuCanceled
, PopupMenuWillBecomeInvisible
and PopupMenuWillBecomeVisible
events which can be used to determine when the menu is opened or closed.
- Authors
John Sullivan
Ingo Maier
Hanns Holger Rutz
- See also
javax.swing.JPopupMenu
Type members
Inherited classlikes
Value members
Concrete methods
Gets or sets the popup menu's label. Different look and feels may choose to display or not display this.
Gets or sets the popup menu's label. Different look and feels may choose to display or not display this.
Attaches the menu to a given component and makes it visible at the relative coordinates.
Attaches the menu to a given component and makes it visible at the relative coordinates.
- Value Params
- invoker
the component to which the menu is logically attached
- x
the horizontal coordinate of the top-left corner of the menu, relative to the invoker's position
- y
the vertical coordinate of the top-left corner of the menu, relative to the invoker's position
Inherited methods
Installed reaction won't receive events from the given publisher anylonger.
Installed reaction won't receive events from the given publisher anylonger.
- Inherited from
- Reactor
Listen to the given publisher as long as deafTo
isn't called for
them.
Listen to the given publisher as long as deafTo
isn't called for
them.
- Inherited from
- Reactor