Would someone please answer a question
If I have a 2 dimensional array and want to change the first element of [1][] to [3][] How can I take all the asscoiated strings in the second elements to follow
example array1 [1][0] = blue
[1][1] = green
[1][2] = red
I want to move 1 and all its characteristics to position 3
[3][0] = blue
[3][1] = green
[3][2] = red
and everything at [3] will move down to 4 and so on
Man stuck on this for 3 days, and no one will help
I don't want the code, just some ideas
Desperate in Orlando
[577 byte] By [
McGuiganJ] at [2007-9-26 3:11:30]

I have no clue if this will actually work, but it's an idea. Maybe you could try it.
Make another array:
datatype array2[][];
array2[3][] = array[1][];
array2[4][] = array[3][];
...
array1[][] = null;
If your datatype is some sort of object, I think array2 steals a copy of the pointers from array1 (they both point to the same memory locations, just different indices now). You may want to dereference array1 so you don't have two arrays using the same memory location.
Like I said, I don't know if this actually works, but it's an idea.
Try this:
public Object[][] stuffIt(int start, int increment, Object[][] input)
{
Object[][] rtnArray = new Object[input.length+increment][input.length+increment];
for (int x=0 ; x < input.length ; x++)
{
for (int y=0 ; y < input.length ; y++)
{
if (x==start)
{
// don't know what to do with array positions
// between start and increment, but do it here
}
if (x >= start)
{
rtnArray[x+increment][y] = input[x][y];
}
else
rtnArray[x][y] = input[x][y];
}
}
return rtnArray;
}