United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6703772 : Regression: JPasswordField doesn't always recognize AltGraph Keystrokes in Java SE 6

Details
Type:
Bug
Submit Date:
2008-05-16
Status:
Closed
Updated Date:
2010-08-04
Project Name:
JDK
Resolved Date:
2009-02-06
Component:
client-libs
OS:
linux,generic
Sub-Component:
java.awt:i18n
CPU:
x86,generic
Priority:
P3
Resolution:
Duplicate
Affected Versions:
6
Fixed Versions:

Related Reports
Duplicate:
Duplicate:

Sub Tasks

Description
A JPasswordField doesn't always recognize AltGraph Keystrokes in Java SE 6. A reproducible testcase is available (it is attached to this CR).

In order to enter special characters, you sometimes need the AltGraph key. Actually that need depends on the keyboard layout you use in your country. In order to enter the at-character ('@') on a german keyboard for example, you need to hit both the AltGraph-Key and the q-Key while on an US keyboard it is enough to use both the shift-key and the 2-key. So in order to reproduce the problem, go and find a localized keyboard first :-D

Testcase:
Run the attached GUI by entering
java -jar PasswdTest.jar

As the testcase has been created with Netbeans 6, you need the libs in the lib folder which has also been provided.

At the GUI you see an editable password text field, a button to transfer the content of the password text field to the two other non-editable text fields below and the Java Version which you are currently using. If you release a key at the password text field, the other two non-editable textfields will be filled with the current content of the password text field. You can force the action also by the button called "Get text".

In the password text field called "Password:" enter "genius@work" for example. Note that you need to enter it manually, character by character and you need to enter it on a keyboard where you need to use the AlgGraph key in order to enter the @-character. If you are on an US keyboard you won't be able to reproduce the problem, because on an US-keyboard you don't need the AltGraph key in order to enter the @-character.
Once you have entered the '@' character you will notice that the 'q' appears rather than the '@' character. You get "geniusqwork" rather than "genius@work".

Note that there is no problem if you copy/paste characters from other applications to the JPasswordField rather than entering them manually with the keyboard.

                                    

Comments
WORK AROUND

Copy the problematic characters into the clipboard and paste them into the JPasswordField rather than entering them manually. Due to security reasons, don't copy the entire, unprotected password to the clipboard.
                                     
2008-05-16
EVALUATION

Assigned to AWT pals to have their opinion,
note that this bug and its duplicate #6699860
both complains of JPasswordField
                                     
2008-06-03
EVALUATION

According to the JPasswordField spec in jdk6,
"NOTE: By default, JPasswordField disables input methods; otherwise, input characters could be visible while they were composed using input methods. If an application needs the input methods support, please use the inherited method, enableInputMethods(true)."
                                     
2008-06-04
EVALUATION

Re-evaluation has been requested, see comments.
                                     
2008-06-04



Hardware and Software, Engineered to Work Together