Can anyone tell me, how to use ListSelectionListener in jtable to get row values and store it an database?
Joined: Jun 13, 2009
I'm not sure I understand the question.
It seems like you want to get the values of a selected row and copy them to a database. If this is the case then you would not want to use a ListSelectionListener. This event fires every time you click on a row or use the arrow keys to move up/down in the table.
Instead I would suggest you need a button like "Update Database". Then you can use the table.getSelectedRows() method to get the index of all selected rows. Then you can loop through the array and access the data in each row by using the getValueAt(...) method for each row and for every column in the row.