public void mousePressed(MouseEvent e) {
		// Stops any moves from being made once the puzzle is solved.
		if (isSolved())
			return;

		// Gets the row and column of the clicked square
		int row = e.getY() / 100;
		int col = e.getX() / 100;

		// get coordinate of black square
		int[] blackSquare = adjacentBlackSquare(row, col);

		int rowOfBlack = blackSquare[0];
		int colOfBlack = blackSquare[1];

		// if there is no black square
		if (rowOfBlack == -1 && colOfBlack == -1) {
			setTitle("Illegal move");
			return;
		} else {
			swap(row, col, rowOfBlack, colOfBlack);
			numMoves++;
		}

		// update the title
		if (isSolved()) {
			setTitle("You won!");
		} else {
			setTitle(numMoves + " moves");
		}
	}