Ok, it was enoght a little serching....
java.util.List data = new java.util.ArrayList();
data.add(new Date());
data.add(new Date());
data.add(new Date());
java.util.Collections.sort(data, new _SortDate());
class _SortDate implements java.util.Comparator {
public SortDate() {}
public int doCompare(Date oo1, Date oo2) {
if (oo1.getTime() > oo2.getTime())
return 1;
else
if (oo2.getTime() > oo1.getTime())
return -1;
else
return 0;
}
}
Date implements Comparable.
So, all you need is:
java.util.List data = new java.util.ArrayList();
data.add(new Date());
data.add(new Date());
data.add(new Date());
java.util.Collections.sort(data);
Please use code tags (see button above posting box).
If you want it to sort in the other direction (I didn't check which way yours goes), change the last line to:
java.util.Collections.sort(data, Collections.reverseOrder());