aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JPopupMenu question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPopupMenu question" Watch "JPopupMenu question" New topic
Author

JPopupMenu question

John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
Is there a way to get a JPopupMenu to expand its menus when clicking instead of when hovering the mouse over the menu?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

So you want to expand/collapse the submenus on mouse movements.
You can get the result by subclassing JMenu and adding a mouse listener to detect the mouse entered and mouse exited events. Check out JMenu#fireMenuXXX methods.

Warning:Take this with a grain of salt. I haven't tried it myself.
Also check out http://www.dontclick.it/


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPopupMenu question