• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Clickable JMenu?

 
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
 
Rancher
Posts: 3204
29
  • 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
Rancher
Posts: 3204
29
  • 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.
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic