Skip to Main Content

Input focus

SunforumsguestOct 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
Post Details
Added on Oct 17 2006
17 comments
433 views