Results 1 to 3 of 3
  1. #1
    paty is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default set focus to the textfield

    Is there a way to set the focus on my textfield so when I run my application I can start typing right away without having to click on my textfield first?
    thanks

  2. #2
    elizabeth is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    you have to write this:
    textField.requestFocusInWindow();

  3. #3
    abrium is offline Member
    Join Date
    Jul 2010
    Posts
    8
    Rep Power
    0

Similar Threads

  1. how to focus to another JTextfield?
    By birdofprey in forum AWT / Swing
    Replies: 2
    Last Post: 04-09-2008, 01:08 PM
  2. add JToolTip on focus gained forJTextField
    By ismailsaleh in forum AWT / Swing
    Replies: 6
    Last Post: 02-01-2008, 12:02 PM
  3. JTable Focus Traversal
    By helios_lie in forum AWT / Swing
    Replies: 1
    Last Post: 12-20-2007, 10:27 AM
  4. JSP - getting value from a textfield
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-01-2007, 08:58 PM
  5. Focus
    By Marty in forum AWT / Swing
    Replies: 1
    Last Post: 05-31-2007, 02:16 AM

Posting Permissions

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