Forums Register Login

TableSorter problem

+Pie Number of slices to send: Send
I implemented sorting example on sun's website: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html . However, there is problem with this code. As I understand TableSorter acts as a shell for my current TableModel, so when I sort JTable is makes changes to TableSorter and TableMap classes but not the TableModel that I use. What should I do so that when I sort JTable, the original TableModel changes as well?
thanks,
Alex
+Pie Number of slices to send: Send
The benefit of this technique is that allows you to use models that are not sortable. TableSorter is a generic sorter that can be applied to any table.
If you really want to sort the model, do not use a wrapper for the model . Just use a model that knows how to sort its data. For instance via the Collections.sort(...) methods, or SortedSet/Map types.
If you're gonna buy things, buy this thing and I get a fat kickback:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 901 times.
Similar Threads
JTable
JTable ........
JTable manipulations
JTable
JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:30:27.