This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 10175
    
    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