Results 1 to 4 of 4
  1. #1
    hamad khan is offline Member
    Join Date
    Jan 2014
    Posts
    3
    Rep Power
    0

    Default jtextfield problem

    i'm working on java gui, facing a problem with the Jtextfield. in order to get any value from jtexfield i have to press enter after the insertion value and than get the respective value.
    Is there any solution to it?
    So that i could be able to get value from jtextfield without pressing enter after the text.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: jtextfield problem

    What do you mean by "get value" ?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: jtextfield problem

    You could add a DocumentListener to the field's Document and get the value every time it changes.
    Get in the habit of using standard Java naming conventions!

  4. #4
    hamad khan is offline Member
    Join Date
    Jan 2014
    Posts
    3
    Rep Power
    0

    Default Re: jtextfield problem

    retrieve value from text field and use it in the program

Similar Threads

  1. JTextField problem
    By maki in forum AWT / Swing
    Replies: 2
    Last Post: 09-01-2013, 06:40 AM
  2. Problem with JTextField
    By waker3210 in forum AWT / Swing
    Replies: 3
    Last Post: 05-17-2012, 06:42 AM
  3. problem with JTextfield..
    By Shahnawaz in forum New To Java
    Replies: 2
    Last Post: 10-04-2011, 08:16 AM
  4. Replies: 0
    Last Post: 08-30-2011, 09:18 AM
  5. Problem with JTextField.. please help!!
    By Asvin in forum New To Java
    Replies: 21
    Last Post: 12-18-2010, 03:49 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
  •