PDA

Click to See Complete Forum and Search --> : JTable Help


fartman_900
Mar 18th, 2006, 10:15 PM
Ok, heres the situation. I have a Jtable with 7 columns and many rows. I want to be able to sort the columns when the header is clicked on. I've search on Google and the API for anything like this, but found nothing of good use.
Does anyone have an idea on how to do this?

Also in the JTable, I want to be able to double click on a row and it opens that file corresponding to the row. The columns basically have info about the file. Again, I searched and nothing. Any ideas?

System_Error
Mar 21st, 2006, 05:33 AM
Sorting the columns would be pretty easy. Add a mouselistener to the table headers, then get the index that was selected, and then use the convertColumnIndexToModel method.