Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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

JMenu

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a menu A which has a sub menu B.Menu B has items x,y,z. If i attach a mnemonic key to menu B,then when I press "ALT + A + B", nothing happens. i want the menu to show x,y,z menu items when i press "ALT + A + B". I find this function should have been inbuilt in java gui. But as this setup doesnt work, is there any other way to achieve this.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never heard of any menu system that will display a sub menu when ALT + A + B is pressed. The way I have seen menus work, ALT + A will bring up the A menu. Pressing a B will bring up the B Sub-menu.
Recently working with menus I found that Listeners are the way to implement most items associated with the clicking of menu items. Check them out.
As you can see I am new to Java Also and I hope I am helping here.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi kelly,
what u have said is exactly what i want. But i am not able to get it done in java swing.
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you need to do is use the setMnemonic function on your two menus. What exactly are you having problems with?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"red goliath" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!

-Nate
 
sam berkley
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi angela,
i did set the mnemonic keys. but the sub menu doesnt pop up when the key is pressed.
 
I don't like that guy. The tiny ad agrees with me.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic