• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable - Sorting rows

 
Mike London
Ranch Hand
Posts: 1288
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTable where a thread populates it with directory information.
I then want to sort it on any of the columns.
I've implemented the SortFilterModel class (that extends AbstractTableModel) technique discussed in Core Java, Volume II.
But the example in this book (Ch 6, advanced Swing) assumes you have the model populated first and you then it immediately creates a SortFilterModel object based on the already-populated DefaultTableModel (that is, after using the constructors from the up-front created arrays).
In my case, I have a set of directories loaded into a JList first that I THEN want to sort.
However, I can't seem to get the display to change to show that rows based on column clicked are now sorted.
I can post code, but it's fairly long.
Has anybody run into this kind of thing before?
Thanks much.
-- Mike
 
Mike London
Ranch Hand
Posts: 1288
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks much for your reply. <s>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!