Don't use a 2-dimensional array but instead create a class to hold the information of each "row" with an int (x), int (y), and Color object and instead create a 1-D array of this or perhaps better an ArrayList of this. If you need more help, please provide us with more detail.