wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Setting focus of JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Setting focus of JTextField" Watch "Setting focus of JTextField" New topic
Author

Setting focus of JTextField

Marcus Hoe
Greenhorn

Joined: May 18, 2001
Posts: 14
Anyone knows how to set focus on specific JTextComponents such as JTextField... after screen loads ?
Renee Zhang
Ranch Hand

Joined: Sep 10, 2001
Posts: 72
Try yourTextField.requestFocus();
It works for me, but you have to put this line after yourFrame.setVisible(true). I don't know if it's a good idea to put any code after yourFrame.setVisible(true).
Good lucks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting focus of JTextField
 
Similar Threads
java swings question
Doubts-Urgent!
RequestFocus doesn't work?
Retaining Focus in Swing
focusLost event