aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Sorting and inserting data in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Sorting and inserting data in JTable" Watch "Sorting and inserting data in JTable" New topic
Author

Sorting and inserting data in JTable

Shyamala Parvathy
Greenhorn

Joined: Jul 07, 2001
Posts: 4
How can i do the sorting the data in the JTable? How can i insert new row in the proper position in the sorted table ? I don't want to reintialise the JTable or the model
San Su
Ranch Hand

Joined: Jul 06, 2001
Posts: 313
There is a table sorter example in sun site.. follow the
link..
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting
It doesnt matter whether the table is sorted or not,
you can always use TableModel.insertRow() method to insert
a new row.
 
wood burning stoves
 
subject: Sorting and inserting data in JTable