Sorting arraylist objects by alpha
Okay i have my arraylist and other methods created.
Now, i need sort my arraylist objects by their alphabetical field, and then print them.
The toString i already have handled.
Does anyone know of a SIMPLE sorting method i can use to sort my array objects by alphabetical, so that i can redisplay them in alphabetical order instead of item number?
[372 byte] By [
Zerofurya] at [2007-11-27 9:20:12]

Use the Collections.sort() method. There are two of them: the one you want is the one that has a Comparator argument.
This Comparator is the thing that allows you to specify how the sort should take place. In your case you will need to make a comparator that takes two of your objects and returns a value based on the string comparison of the relevant fields.
The Collections API is here: http://java.sun.com/javase/6/docs/api/java/util/Collections.html
JavaWorld has a nice article discussing the problem here: http://www.javaworld.com/javaworld/jw-12-2002/jw-1227-sort.html