java - How to have jtables values which are strings in alphabetical order using comparator and tablerowsorter? -
the title says clearly. wanted use quicksort algorithm 1 of friends said use comparator don't know how to.
you must create comparator:
comparator<string> comparator = new comparator<string>() { public int compare(string s1, string s2) { return s1.compareto(s2); } };
with comparator able sort data in alphabetical order.
after create sorter , pass comparator , model of jtable.
then:
sorter.sort();
i think after data sorted.
Comments
Post a Comment