This week's giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP and have Lucian Maly on-line!
See this thread for details.
Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

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: 24203
44
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.
 
Seriously? That's what you're going with? I prefer this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic