Is it possible to invoke the auto row sorter in a jtable

user979490 picture user979490 · Oct 26, 2011 · Viewed 8.4k times · Source

is there anyway to invoke the auto row sorter in a jtable that is created by using

setAutoCreateRowSorter(true);

i'm trying to get it to sort by a default column without the user having to click on on the column header.

Answer

kleopatra picture kleopatra · Oct 26, 2011
table.getRowSorter().toggleSortOrder(modelColumnIndex)