private void refreshView() {
		int recentGrid[][] = this.sudoku.getRecentGrid();
		int startGrid[][] = this.sudoku.getStartGrid();
		int startFilledFields = 0;
		int userFilledFields = 0;

		/*
		 * Iterate through every cell.
		 */
		for (int y = 0; y < sudoku.getSize(); y++) {
			for (int x = 0; x < sudoku.getSize(); x++) {
				gameField[y][x].setEnabled(true);
				if (startGrid[y][x] != 0) { // If it is in the startGrid, make
											// it non-editable for the user.
					gameField[y][x].setText(String.valueOf(startGrid[y][x]));
					gameField[y][x].setEnabled(false);
					gameField[y][x].setDisabledTextColor(new Color(120, 120,
							120)); // Sudoku-Grey
					startFilledFields++;
				} else if (recentGrid[y][x] != 0) { // Set the content as text
					gameField[y][x].setText(String.valueOf(recentGrid[y][x]));
					userFilledFields++;
				} else { // If the cell is 0, set an empty string as text.
					gameField[y][x].setText("");
				}
			}
		}

		/*
		 * Activate / deactivate the buttonValidate. Is dependent on solvingMode
		 * and whether grid is filled.
		 */
		if (!solvingMode
				&& startFilledFields + userFilledFields == sudoku.getSize()
						* sudoku.getSize()) {
			btnValidate.setEnabled(true);
		} else if (solvingMode
				&& startFilledFields + userFilledFields != sudoku.getSize()
						* sudoku.getSize()) {
			btnValidate.setEnabled(true);
		} else {
			btnValidate.setEnabled(false);
		}

		/*
		 * Disables / enables the undo / redo buttons, if its possible /
		 * impossible.
		 */
		checkUndoRedoButtons();

		/*
		 * Do not update the progress bar if in solving mode (since the progress
		 * bar is (ab)used for displaying texts).
		 */
		if (!solvingMode) {
			prgrBar.setValue(100 * userFilledFields
					/ (sudoku.getSize() * sudoku.getSize() - startFilledFields));
			prgrBar.setString(prgrBar.getValue() + "% Done");
			prgrBar.getRootPane().repaint();
		}
		frame.repaint();
	}