• Post Reply Bookmark Topic Watch Topic
  • New Topic

using TableRowSorter

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm using java 6 and added TableRowSorter to sort my jtable:

from what i realized, this sorter sorts all columns as String, like:
1
10
11
12
13
14
15
16
17
18
19
2
20
and so on

i wrote this code:

but i'm totally helpless on how to implement a comparator, set it to TableRowSorter and have all of it working

Can someone please help me?

TiA
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i the meanwhile i made:

and then


but all remains the same
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!