aspose file tools
The moose likes Java in General and the fly likes Using Label Mnemonic corrupts focused field? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Using Label Mnemonic corrupts focused field?" Watch "Using Label Mnemonic corrupts focused field?" New topic
Author

Using Label Mnemonic corrupts focused field?

john cummings
Greenhorn

Joined: Oct 26, 2001
Posts: 3
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

Joined: Sep 29, 2000
Posts: 8521
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.


"JavaRanch, where the deer and the Certified play" - David O'Meara
john cummings
Greenhorn

Joined: Oct 26, 2001
Posts: 3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Label Mnemonic corrupts focused field?
 
Similar Threads
Decode the Mnemonic
setDisplayedMnemonic corrupts JTextField??
JTabbedPane Problem
button mnemonic
setMnemonic