aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Cursor position in a JPasswordField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Cursor position in a JPasswordField" Watch "Cursor position in a JPasswordField" New topic
Author

Cursor position in a JPasswordField

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I have a JPasswordField in a JDialog. The first time in the dialog it works
fine. However, on subsequent entries, when tabbing to the JPasswordField,
the cursor appears several characters into the field instead of at the
beginning. Any suggestions?

Thanks.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Do you clean up the password text? Are you reusing the dialog?

--
./pope
[the_mindstorm]


blog - InfoQ.com
Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Yes. It is being reused. Currently reset password with a
setText( "" );
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Can you paste the code? It is not clear what is happening. Have you tried to select the advance space in password text? Is it always the same? Isn't it another tab character?

--
./pope
[the_mindstorm]
Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
The JPassword field is called mTLSupervisorEmpNumber. The code is :

mTLSupervisorEmpNumber.setText( "" );
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
lol Barry. I meant all the code involving at least the password text.

--
./pope
[the_mindstorm]
 
wood burning stoves
 
subject: Cursor position in a JPasswordField