Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JMenu  RSS feed

 
red goliath
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.
 
Kelly Harris
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.
 
sam berkley
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.
 
Angela Lamb
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?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!