Thursday, July 24, 2003 05:10 AM
I'm trying to understand why
The data structure you are using mixes the metaphors. You should have one vector for the Strings and one for the numbers, then place those two vectors in the parent container.
If you are set on using Vectors, here's a better way to do this.
Vector outerVector = new Vector();
Vector innerVector1 = new Vector();
Vector innerVector2 = new Vector();
Now you can use the collections sort to sort the second and first vectors any way you want.
The movement of innerVector1 is not tied to the movement of innerVector2.
You might want to get a book on Data Structures in Java, however. Then, you would see about 100 better ways to do this.