Results 1 to 4 of 4

Thread: Setting Focus on JTexField

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Setting Focus on JTexField

    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.
    ______________________________________

    Warmest Regards,

    Lex
    ______________________________________



    :|: Don't Mess With The Predator :|:

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Setting Focus on JTexField

    Believe you can use setFocus();

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Setting Focus on JTexField

    Try this :

    Code:
    nameField.requestFocus();


    Has someone helped you? Then you can Rate their helpful post.

  4. #4
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Setting Focus on JTexField

    Yep, that's it requestFocus();

    Sorry there lex.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width