File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sorting JTable in asc. or desc.?

 
Wickes Potgieter
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it necessary to provide the functionality of sorting the table data in ascending or descending when the user clicks the header of the column?
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Wickes,
It is not a requirement and don't feel compelled to implement table sorting. Having said that I did implement table sorting in both ascending and descending order. If the user clicked on a column hearder, the table would sort in ascending order on that column. If he clicked on the same column again it would sort in descending order on that column. Additionally, I appended a "+" or "-" to the column header title to indicate on which column the table was sorted and in what direction.
Hope this helps,
Michael Morris
 
Wickes Potgieter
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes that helps, thank you Mike!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic