Hi I'm doing a project in java.It is the game othello.It was all going well till i got an ArrayOutOfBoundsException. the array is this buttons[9][9]; If you dont know othello it's a board game with an 8x8 board.
The Exact error is "ArrayOutOfBoundsException: 9" and give the lines which the error is which are:
1->
if (the_buttons[rows][colunm+1].getIcon().equals(BG)== true &&
the_buttons[rows+1][colunm].getIcon().equals(BG)== true &&
the_buttons[rows][colunm-1].getIcon().equals(BG)== true &&
the_buttons[rows-1][colunm].getIcon().equals(BG)== true )
{
dialog(2);
return false;
}
return true;
2->
if(checkIfOccupied() == false && checkForSq()== true )
{
if(checkIflegal()==true)
{
if (checkWhichPlayer()==true)
{ the_buttons[rows][colunm].setIcon(r);
checkForward(r,Y) ;
checkUpLeft(r,Y) ;
checkUpRight(r,Y) ;
checkBackwards(r,Y);
checkDownLeft(r,Y) ;
checkDownRight(r,Y);
checkDown(r,Y) ;
checkUp(r,Y) ;
}
3->
if (cmd.equals(""+i))
{
checkforColunm(j=0,i);
PickButton(rows,colunm);
}
CAN ANYONE HELP IT'S THE LAST HURDEL AND THIS NEEDS TO BE IN TOMORROW.....