Section 22.5 JPopupMenu
• Context-sensitive pop-up menus (p. 925) are created with class JPopupMenu
. The pop-up trigger event occurs normally when the user presses and releases the right mouse button. MouseEvent
method isPopupTrigger
(p. 928) returns true
if the pop-up trigger event occurred.
• JPopupMenu
method show
(p. 928) displays a JPopupMenu
. The first argument specifies the origin component, which helps determine where the JPopupMenu
will appear. The last two arguments are the coordinates from the origin component’s upper-left corner, at which the JPopupMenu
appears.
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.