File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Mnemonics problem on Mac OS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Mnemonics problem on Mac OS" Watch "Mnemonics problem on Mac OS" New topic
Author

Mnemonics problem on Mac OS

Sigrid Kajdan
Ranch Hand

Joined: Jan 14, 2007
Posts: 72
Hi all,

I have a problem with the keyboard shortcuts (mnemonics) - when the cursor is in a text field after entering e.g. the database location, when I now click alt + the corresponding key for a button, the character assigned to this combination is first inserted to the text field and then the button's listener is called, resulting in an invalid field content.

I started development on linux first and only recently switched to Mac OS. If I remember correctly, I did not have this problem on linux.

Does anyone have the same problem and perhaps have an idea what I can do?

Thanks a lot in advance,
Sigrid
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2346
    
    7

You may want to include the isAltDown()==true in the keylistener. So this will ensure alt key is pressed with the letter key in order to activate the mnemonic.

You mentioned the Alt+key combo is first entered in the text field... try printing the text in the text field too. If this text includes the combo, you have another problem even if the trigger works.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Sigrid Kajdan
Ranch Hand

Joined: Jan 14, 2007
Posts: 72
Hi Tsang,

thanks for your answer.
Yes, unfortunately I have the problem of the "non-requested" character really ending up in the text field - so I really have an invalid entry in the text field!

(The listener itself works - first the character is entered and then immediately the listener is called...)

ciao,
Sigrid

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mnemonics problem on Mac OS