• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

JList selection change with button Mnemonic

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All, I'm fairly new to the Java World.
I have a dialog with buttons(which have mnemonics) and with a JList. When I attempt to invoke buttons via the mnemonics via the alt key the JList selection is changing as well.
I could probably handle key input in my JList class and detect if the Alt key is pressed however the my entire application is littered with dialogs with the same scenerio.
I would like to resolve this problem in one spot if possible. Could this be done using the UIManager?
Thanks in advance,
Rob.
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you specifically adding key listeners to your JLists? I didn't think they changed selection upon key entry by default (except arrow keys).
If you are adding key listeners individually, either check for Alt there or (better yet, if the functionality is common), create your own class which extends JList, do the stuff you want in there, and then search/replace instances of JList with your class.
Bill
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic