• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sorting and inserting data in JTable

 
Shyamala Parvathy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic