• Post Reply Bookmark Topic Watch Topic
  • New Topic

Clickable JMenu?

 
Johann Dobbins
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an easy way to create a clickable JMenu? Basically, a JMenuItem capable of having a submenu. Or a JMenu capable of having an associated action and accelerator?

Thank You
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an easy way to create a clickable JMenu? Basically, a JMenuItem capable of having a submenu.


Don't understand the concept. How do you distinguish from a click that invokes the Action, versus a click that display the sub menu?
 
Johann Dobbins
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:
Is there an easy way to create a clickable JMenu? Basically, a JMenuItem capable of having a submenu.


Don't understand the concept. How do you distinguish from a click that invokes the Action, versus a click that display the sub menu?


I'm not sure if this is L&F dependent, but in Xp, hovering over a JMenu displays the submenu. As does pressing the right arrow on a selected JMenu (not L&F dependent). So, I wouldn't mind making the click only invoke the action.

The "Save As" in Word 2007, works as I would like this to.
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMenu extends JMenuItem, so therefore something in the JMenu UI is changing the behavour. I have no idea where it is changed but I would suggested you would therefore also need to customize the UI to do what you want.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!