Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

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
536 views