Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Input focus

843805Oct 17 2006 — edited Aug 19 2009
I have the following two lines in a program:
JPasswordField jpf = new JPasswordField(10);
JOptionPane.showMessageDialog(null , jpf , "Enter the Password" , JOptionPane.QUESTION_MESSAGE);
No matter what I try, I can't seem to get input focus without having to first click in the field.
Any suggestions?

Thanx one and all.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2009
Added on Oct 17 2006
17 comments
627 views