Search code examples
javaswingsortingjtabletablerowsorter

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


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.


Solution

  • table.getRowSorter().toggleSortOrder(modelColumnIndex)