Have you tried implementing the Comparator/Comparable interface (not sure which it is, Sun's tutorial is quite vague, if all else fails implement both interfaces)?

Here's Sun's tutorial for using...