Results 1 to 5 of 5
  1. #1
    VineetKumar is offline Member
    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0

    Default how to point cursor on the 1st text field in a jframe

    I have created a JFrame which is taking some inputs from the user. This form contains some JTextFields. I want to point the cursor to the 1st text field in the frame. how do i do it?
    Currently, user needs to select the field first and then enter the data.

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    The mouse cursor or the text cursor? For the latter use requestFocusInWindow()
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    VineetKumar is offline Member
    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0

    Default how to point cursor on the 1st text field in a jframe

    i mean text cursor

  4. #4
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    So use requestFocusInWindow()
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  5. #5
    k2k
    k2k is offline Member
    Join Date
    Feb 2009
    Posts
    6
    Rep Power
    0

Similar Threads

  1. How To add the Text field to the TextArea or TextPane
    By Chintan Patel in forum AWT / Swing
    Replies: 3
    Last Post: 04-08-2009, 02:46 AM
  2. Insert text at abitrary point in a JTextPane
    By angues in forum AWT / Swing
    Replies: 6
    Last Post: 02-02-2009, 04:08 PM
  3. launching Jframe from text field
    By crunchymonkey in forum AWT / Swing
    Replies: 4
    Last Post: 10-15-2008, 02:50 AM
  4. get numeric value from a text field
    By Lehane_9 in forum New To Java
    Replies: 2
    Last Post: 06-14-2008, 03:19 AM
  5. Regarding Text Field
    By adeeb in forum AWT / Swing
    Replies: 1
    Last Post: 06-05-2008, 11:01 PM

Posting Permissions

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