public void initializePuzzle(int[][] array) { int[][] tempArray1 = new int[4][4]; int[][] tempArray2 = new int[4][4]; int[][] tempArray3 = new int[4][4]; for (int i = 0; i <= 3; i++) { for (int j = 0; j <= 3; j++) { tempArray1[i][j] = array[i][j]; } } for (int i = 4; i < array.length; i++) { for (int j = 0; j <= 3; j++) { tempArray2[i - 4][j] = array[i][j]; } } for (int i = 0; i <= 3; i++) { for (int j = 4; j < array.length; j++) { tempArray3[i][j - 4] = array[i][j]; } } block1 = new Block(tempArray1); block1.setButtons(); block2 = new Block(tempArray2); block2.setButtons(); block3 = new Block(tempArray3); block3.setButtons(); }