posted 22 years ago
Hi,
you could investigate the java.util.Arrays or java.util.Collections APIs. They have various methods for performing sorting on arrays or lists.
I tried the following code:
When run under windows, the File[] is already sorted for you, but when run under Unix I needed to add the call to Arrays.sort(Object[]).
If the desired sorting isn't what you are after then you will have to define your own custom sorting by implementing Comparator and calling something like Arrays.sort(Object[] myArray, Comparator myComparator).
James.