PDA

Click to See Complete Forum and Search --> : Setting Focus on JTexField


Lex@SG
Sep 24th, 2005, 03:08 AM
Hi,

May i know how do i go about setting focus on a JTextField when my window is opened? As in, when I compiled and run the application, the focus is on the JTextField I specified.

Thank you.

System_Error
Sep 24th, 2005, 08:23 AM
Believe you can use setFocus();

manavo11
Sep 24th, 2005, 08:29 AM
Try this :

nameField.requestFocus();

System_Error
Sep 24th, 2005, 09:39 AM
Yep, that's it requestFocus();

Sorry there lex.