Results 1 to 4 of 4
  1. #1
    Dcalladi is offline Member
    Join Date
    Oct 2011
    Posts
    27
    Rep Power
    0

    Default Filling Text Field from information from JTable

    Hi i am currently doing some work for university. i have a JTable populated from a SQL Database i am looking for a way when i select the row all of the information is set into some JTextFields. then obviously when i select a different row the new information will be put into the
    JTextFields . i know ill have to have some kind of listener but any advice or snippets of code or links to something that might help would be
    very appreciated

    Thank you

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Filling Text Field from information from JTable

    get the JTable's ListSelectionModel via its getSelectionModel() method and add a ListSelectionListener to the model.

  3. #3
    Dcalladi is offline Member
    Join Date
    Oct 2011
    Posts
    27
    Rep Power
    0

    Default Re: Filling Text Field from information from JTable

    Thank you, i managed to work it out in the end but then a bunch of other problems appeared. :)

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Filling Text Field from information from JTable

    Quote Originally Posted by Dcalladi View Post
    Thank you, i managed to work it out in the end but then a bunch of other problems appeared. :)
    Welcome to programming. :)

Similar Threads

  1. Filling a JTable
    By aborgeld in forum Advanced Java
    Replies: 0
    Last Post: 01-08-2011, 01:37 PM
  2. insert data from text field to jtable
    By mackinas in forum New To Java
    Replies: 2
    Last Post: 06-09-2010, 04:30 AM
  3. Problems getting JTable to display information
    By Gatts79 in forum AWT / Swing
    Replies: 2
    Last Post: 11-08-2008, 02:35 AM
  4. Getting class field information using Reflection
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-24-2008, 03:20 PM
  5. Adding information to a JTable in a JTabbedPane
    By bigpappatrader in forum AWT / Swing
    Replies: 0
    Last Post: 12-05-2007, 07:09 AM

Tags for this Thread

Posting Permissions

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