I have an [] that has some numbers (distances from some point). I want to create an array of indexes into the first array where the indexes are sorted by the distance.>
You should customize your own Comparator and use java API.
http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html#sort(java.lang.Object[],%20int,%20int)
http://docs.oracle.com/javase/tutorial/collections/interfaces/order.html