FULL PRODUCT VERSION :
java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft windows 2000 5.00.2195 Service pack 4
EXTRA RELEVANT SYSTEM CONFIGURATION :
no relevant information
A DESCRIPTION OF THE PROBLEM :
The javadoc tells us that the method AbstractButton.setMnemonic(int mnemonic) is case-insensitive, but that not true. It only works if the int reprecents a uppercase from A -> Z.
The method AbstractButton.setMnemonic(char mnemonic) works perfect for characters a->z en A-> Z, but this method is obsolete.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a menu with different menuItems. Define a mnemonic on a lowercase of the menuItem and try to activate the menuItem using his mnemonic.
This doesn't work if you use the method setMnemonic(int mnemonic) with the mnemonic as lower-case representation.
Use the method setMnemonic(char mnemonic) with the mnemonic as lower-case and it works perfectly.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
This doesn't work if you use the method setMnemonic(int mnemonic) with the mnemonic as lower-case representation.
Use the method setMnemonic(char mnemonic) with the mnemonic as lower-case and it works perfectly.
ACTUAL -
This doesn't work if you use the method setMnemonic(int mnemonic) with the mnemonic as lower-case representation.
Use the method setMnemonic(char mnemonic) with the mnemonic as lower-case and it works perfectly.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No messages, just no activation of the menuitem
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Do a Charactor.uppercase(mnemonic) before doing the setMnemonic(int mnemonic).