• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sort by java.sql.Timestamp in JTable

 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I would like my jtable to sort by a column that contains timestamps(java.sql.Timestamp). How should I do so ?
 
Piyush Patel
Ranch Hand
Posts: 127
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you query for result set to database write query such that it give you sorted results by date !!
 
Rob Camick
Ranch Hand
Posts: 2700
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the JTable API and follow the link to the Swing tutorial on "How to Use Tables", which contains a working example of how to add a Sorter to a table.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!