Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Focusing A Jtextfield (http://www.programmingforums.org/showthread.php?t=1172)

T3FLoN Nov 17th, 2004 12:20 AM

I made a guessing game and id like to know how to make the program focus itself on my text field after each press of the guess button, instead of alwayz having to click in the field to get a cursor to enter your next guess.

Mjordan2nd Nov 17th, 2004 12:25 AM

Not positive, but couldn't you just say

textfileld.focus()?

T3FLoN Nov 17th, 2004 12:28 AM

nope that didnt work i tried a boolean in it too and nothig.

groovicus Nov 17th, 2004 8:45 AM

How about

tf.hasFocus(true);
or
tf.requestFocus();

:D

tempest Nov 17th, 2004 8:46 AM

tf.focus(); ?? // Its javascript, sue me :P


All times are GMT -5. The time now is 1:11 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC