• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting the index of the row in JTable  RSS feed

 
VenuArchana Aradhyula
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table which consists of columns like Select,Col1,Col2.
Select column is of Checkbox.

Let us assume that this table consists of 10 rows of data.
Now if i select the 5th row here i want to get the index of the checked 5th row.

Thanks
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a ListSelectionListener to the table's ListSelectionModel. You can retrieve the latter using JTable.getSelectionModel().
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!