I have a JTable which contains TableModel(all my data). The JTable has multiple rows and columns. I need to shuffle the rows randomly. I understand I can do that with
Collections.shuffle(some list from TableModel);
But I dont know how to get the list from the existing JTable which had TableModel.
on somebodies suggestion, I tried this
RowSorter<? extends TableModel> sorter = mDocListTable.getRowSorter();
ArrayList<RowSorter.SortKey> list = new ArrayList<RowSorter.SortKey>();
list.add(new RowSorter.SortKey(0, SortOrder.DESCENDING));
Collections.shuffle(list);
sorter.setSortKeys(list);
but didnt work.