wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 10167
    
    8

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
 
Similar Threads
show and hide a JPopupMenu
Swing
Scrolling JPopup Menu
How to make JPopupMenu invisible?
Problem while working with JPopupMenu