Well, once you have a basic understanding of 2d arrays, the rest of the program is just a bunch of if/else if statements and nested for loops.
As for a starting point, I'd recommend finding a good tutorial over 2d arrays to give you a basic understanding of them. I really can't think of any off the top of my head, but a quick Google search may bring you to several which can help.
Basically, you just need to know that a 2d array is just a regular array with multiple rows. To create one, you just add another [] such as:
int[][] anArray = new int[[I]number of rows here[/I]][[I]number of columns here[/I]]
As far as putting values inside the array, there are a couple ways you can do that. You can use a nested for loop, for example if you wanted all values to be 0:
for (int row = 0; row < anArray.length; row ++)
for (int col = 0; col < anArray[row].length; col++)
anArray[row][col] = 0;
Or if you know the exact values and where they belong, which seems like you do in this case, you can do something like this:
int[][] anArray = {{1, 2, 3},
{4, 5, 6},
{7, 8, 9}}
I hope this helps you get started!