PopupMenu
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)
}}}
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
events which can be used to determine when the menu is opened or closed.
PopupMenuCanceled
, PopupMenuWillBecomeInvisible
and PopupMenuWillBecomeVisible
events which can be used to determine when the menu is opened or closed.
- Authors
- John SullivanIngo MaierHanns Holger Rutz
- See also
- javax.swing.JPopupMenu
trait Wrapper
trait Wrapper
trait SequentialContainer
trait Container
class Component
trait PeerContainer
trait UIElement
trait LazyPublisher
trait Publisher
trait Reactor
trait Proxy
class Object
trait Matchable
class Any
Type members
Value members
Methods
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
Fields
Inherited methods
def scala$swing$LazyPublisher$$super$unsubscribe(listener: Reaction): Unit
- Inhertied from
- LazyPublisher
def deafTo(ps: Publisher*): Unit
Installed reaction won't receive events from the given publisher anylonger.
- Inhertied from
- Reactor
def listenTo(ps: Publisher*): Unit
Listen to the given publisher as long as deafTo isn't called for
them.
them.
- Inhertied from
- Reactor
override def unsubscribe(listener: Reaction): Unit
- Definition Classes
- LazyPublisher -> Publisher
- Inhertied from
- LazyPublisher
override def subscribe(listener: Reaction): Unit
- Definition Classes
- LazyPublisher -> Publisher
- Inhertied from
- LazyPublisher