Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Label Mnemonic corrupts focused field?

 
john cummings
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Windows ME.
When a JTextField has focus and I use alt *(anything) to switch to another component the mnemonic character is typed into the field that has the focus. yuk! How can I avoid this? (Creating a JDialog for SCJD exam and trying to stick with recommened Look and Feel conventions).
Thanks, jc

 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I guess you could put a KeyListener on the input fields and watch for the key combination and consume them if found. Seems like there should be a better way.
 
john cummings
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cindy, but, if I consume the KeyStroke is the "jump" to the field identified by the label's mnemonic still going to occur?
This caveat
"Note: Due to bug # 4186905, text components don't forward key-typed events in JDK 1.2 for Win32."
appears in the Java Tutorial. Am I bumping into that?
Thanks for the response. Great site. jc
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic