Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextField  RSS feed

 
Lalit Surana
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to have the focus on JTextField when the Login form opens. To do this, I have tried these 2 options:
1.void this_windowOpened(WindowEvent e){
jTxtUsername.requestFocus();
}
2.void this_windowActivated(WindowEvent e){
jTxtUsername.requestFocus();
}
But the JTextField just does not gets the focus. Instead the focus is always with the component below the JTextField, i.e. with JPasswordField.
I have not explicity passed the focus to JPassword, and canot figure out how is the focus shifting
Thanks for reading this looong problem.....
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the code of your login form?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!