Results 1 to 2 of 2
  1. #1
    asai is offline Senior Member
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    115
    Rep Power
    0

    Default Select a row in a table

    Hi,

    I have a table that display all the content from a MySQL table.
    Now I would like to add a button that gets all the details from the highlighted row in my table.
    Any suggestions on how to write this code?

  2. #2
    gauravfzd's Avatar
    gauravfzd is offline Member
    Join Date
    Oct 2010
    Location
    India
    Posts
    72
    Rep Power
    0

    Default Re: Select a row in a table

    There is a method in JTable by which you can access the selected row in the table. I don't remember it correctly but I think it is getSelectedRow() . If not then consider the J2SE Javadoc to get the method of JTable class.
    You can also get the data for a particular cell intersected by a partucalar row and column indexes....

    Build a habit to refer the Javadoc......

Similar Threads

  1. Replies: 3
    Last Post: 02-23-2012, 10:30 AM
  2. Replies: 1
    Last Post: 09-27-2011, 07:06 AM
  3. java method to select from diffrent table
    By waboke in forum New To Java
    Replies: 2
    Last Post: 04-24-2010, 02:58 PM
  4. Replies: 1
    Last Post: 01-08-2010, 07:19 AM
  5. How to retain value in struts 2 using <s:select></s:select> tag
    By SaiPrasad@Sella in forum Web Frameworks
    Replies: 0
    Last Post: 02-09-2009, 08:23 AM

Posting Permissions

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