Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By Fubarable

Thread: Jtable and JTextField

  1. #1
    ehsan is offline Member
    Join Date
    Jul 2011
    Posts
    10
    Rep Power
    0

    Default Jtable and JTextField

    Hi Every one. I Connected JTable to database with out problem , but i have question that how can send information from jtable to jtextField when Click on jtables's row ??


    tnx

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

    Default

    You can get the table's selection model by calling getSelectionModel() on the JTable, and then add a ListSelectionListener to the model:

    Java Code:
    table.getSelectionModel().addListSelectionListener(....);
    This is spelled out in the JTable section of the swing tutorials: How to use JTables

  3. #3
    ehsan is offline Member
    Join Date
    Jul 2011
    Posts
    10
    Rep Power
    0

    Default

    Tnx , can you give me a reference because i'm beginner in java

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

    Default

    Quote Originally Posted by ehsan View Post
    Tnx , can you give me a reference because i'm beginner in java
    I thought that I already did.
    DarrylBurke likes this.

Similar Threads

  1. Replies: 6
    Last Post: 11-19-2010, 08:44 PM
  2. Replies: 1
    Last Post: 01-30-2009, 07:44 PM
  3. JtextField
    By kashifu in forum Advanced Java
    Replies: 2
    Last Post: 06-27-2008, 05:25 PM
  4. Replies: 2
    Last Post: 05-15-2008, 11:15 AM
  5. help with JTextfield
    By gary in forum New To Java
    Replies: 4
    Last Post: 07-11-2007, 02:58 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
  •