• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting on 3 fields and want to only reset 1  RSS feed

 
Tom Landry
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently sorting my JTable on 3 different columns.
Able to reset all sorting columns by setting my sorter to null, but really just want to reset the 3rd column used for sorting so that only two columns are used instead of 3.
Is there a way to "unset" a specific column from the list of sorting columns?
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the DefaultRowSorter class.

You should be able to use the getSortKeys() method, remove the last item in the List and then use the setSortKeys() method.
 
Tom Landry
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for taking the time to reply, but by the time i went to research the info for this it became a moot point as I didn't need it anymore. ;-)
I will definitely play around with it as time permits.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!