Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: get values from database and set them in text fields

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    24
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default get values from database and set them in text fields

    I have a button in which I need to do the following:
    After I click it It reads the values given in a jtextfield1
    and in the other jtextfields I need it to settext in them from the database
    I mean if I have for example id=1
    when I click the button it goes to the database and find the id 1 then write the infos in the other textfields


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,354
    Thanks
    49
    Thanked 2,206 Times in 2,179 Posts

    Default Re: get values from database and set them in text fields

    Have you read the tutorial about action listeners?
    How to Write an Action Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Issues with JApplet and Text Fields
    By schiefer740 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: April 27th, 2012, 05:51 PM
  2. Get dynamic Text fields values
    By John kee in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 24th, 2011, 06:15 AM
  3. repeat creation of text fields
    By kurt-hardy in forum AWT / Java Swing
    Replies: 1
    Last Post: December 6th, 2010, 11:05 AM
  4. Cannot set class fields using textInput
    By javascrub in forum What's Wrong With My Code?
    Replies: 0
    Last Post: August 26th, 2010, 04:04 AM
  5. Putting text fields in an array
    By Movies32 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 10th, 2010, 06:46 PM

Tags for this Thread