question: @ Override public void actionPerformed ( ActionEvent ae ) { for ( int i = 0 ; i < currSize * currSize ; i ++ ) { if ( ae . getSource ( ) == squareButtons [ i ] ) { NQueensController contr = ( NQueensController ) getController ( ) ; XYLocation loc = new XYLocation ( i % currSize , i / currSize ) ; contr . modifySquare ( loc ) ; } } }
target:  When the user presses square buttons the board state is modified accordingly.