There is another way of solving this: just list them all (listFiles), then use Arrays.sort to sort them. You will need a Comparator for that:
This will also help you with the sorting of your files. You cannot assume that listFiles will return your files in alphabetical order; some operating systems use creation date sorting.
Of course this method is O(n log n) against the O(n) of listing the files twice, then merging, but unless there are a lot of files / folders in each folder you won't notice the difference.
By the way, that code came out of my own FileTreeModel, so it has proven itself already in existing code
[ June 11, 2008: Message edited by: Rob Prime ]