This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Please use the code button and a consistent indentation convention; this is a good example. I have added code tags so you can see how much better they look.
Please tell us what problem you are having; I can see a potential problem which you might not have noticed.
When you are iterating through an array with a for loop the preferred style is
for (int i = 0; i < myArray.length; i++) . . .
Don't try varying it and don't put numbers in there (except the 0); that format always works. [Pedantic mode]There is no such thing as a 2-D array in Java, only an array of arrays; since the arrays are often different lengths that form of for loop will still work when you change it to for (int j = 0; j < myArray[i].length; j++) . . . [/pedantic mode]
And you could also try this format
for (int i = myArray.length - 1; i >= 0; i--) . . .