This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Sorting JTable in asc. or desc.? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Sorting JTable in asc. or desc.?" Watch "Sorting JTable in asc. or desc.?" New topic
Author

Sorting JTable in asc. or desc.?

Wickes Potgieter
Ranch Hand

Joined: Apr 05, 2002
Posts: 68
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?


Wickes Potgieter<br />SCJP<br />BEA Certified Specialist: Server, Integration, Portal, Tuxedo<br />BEA WebLogic Server 7 Certified Enterprise Developer<br />BEA Certified Architect<br /><a href="http://www.bea.com" target="_blank" rel="nofollow">www.bea.com</a>
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
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


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Wickes Potgieter
Ranch Hand

Joined: Apr 05, 2002
Posts: 68
Yes that helps, thank you Mike!
 
jQuery in Action, 2nd edition
 
subject: Sorting JTable in asc. or desc.?
 
Similar Threads
Error
javac not recognized as an internal or external command
How do I include a custom font in a NetBean project?
Multi Level Sorting
Problem with Jar