Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2010
    Posts
    23
    Rep Power
    0

    Question Setting jTable cell?

    I am making a program of database , i want to click on a row and all of its information will be listed in a text box below. But if i do it with jtable renderer way then then nothing goes right? Please help , i juat want a sample code.:eek:

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    I have no idea what a renderer has to do with anything. When you click on a row you need to know the index of the selected row, which you can determine by looking at the methods of the JTable API. Then you update each text field with code like:

    Java Code:
    textField0.setText( table.getValueAt(row, 0) );
    textField1.setText( table.getValueAt(row, 1) );

  3. #3
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    And how is that question related to Java2D?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    I've move to the correct place. @OP, please choose the correct sub-forum next time when you posting again.

  5. #5
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Uhm Eranga, don't you think this is a Swing question?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. JTable Cell Merg
    By anilkumar_vist in forum AWT / Swing
    Replies: 8
    Last Post: 04-25-2011, 10:32 AM
  2. Jtable and cell coordinates
    By rattaman in forum AWT / Swing
    Replies: 2
    Last Post: 11-17-2009, 06:48 PM
  3. add a check box to only one cell in a JTable
    By aruna1 in forum New To Java
    Replies: 4
    Last Post: 04-03-2009, 07:28 PM
  4. Color cell in JTable
    By ippacciani in forum AWT / Swing
    Replies: 3
    Last Post: 03-25-2009, 12:53 PM
  5. set different font for each cell in JTable
    By success21061985 in forum AWT / Swing
    Replies: 3
    Last Post: 09-10-2008, 03:06 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
  •