Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPopupMenu question

 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic