• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

KeyListener in JMenu

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a container with a jframe, a jmenubar with a jmenu added. i have a keylistener added to a jbutton which is added to my container, and it all works. however, i want to add a keylistener to my jmenu, so that when the list pops up, maybe you can hit 'a' to have it jump to the items that start with a, etc etc. i tried jm.addKeyListener(this);, but under my keyTyped() method, nothing happens when the jmenu is open and i type keys. im fairly sure im using the code correctly, because keyTyped() is working for my jbutton, but not my jmenu. is there something specific i have to do in order to trigger keyevents from inside a jmenu? to make sure im being clear, im talking about typing inside the jmenu that pops up after you click on the jmenu (or in this case, run the jm.doClick() method. Thanks for your time.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not exactly sure about the answer to your question. You will probably have more luck asking in the GUI forum, if you haven't already. (And if you have, shame on you for cross posting!)

Layne
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed. I'll move this to the Swing/AWT forum for you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic