@Override
	public void mouseClicked(MouseEvent e) {
		int i = e.getY() / 50;
		int j = e.getX() / 50;

		PlayerMusic playerMusic;
		if (selected == null) {
			playerMusic = new PlayerMusic("sounds/1.mp3");
			playerMusic.play();
			selected = squares[i][j];
			customCursor();
		} else {
			try {
				setCursor(null);
				if (validaTroca(i, j)
						&& (squares[i][j].getPos() == 9 || selected.getPos() == 9)) {
					Square aux = (Square) squares[i][j].clone();
					squares[i][j].setPos(selected.getPos());
					squares[i][j].setImage(selected.getImage());
					selected.setImage(aux.getImage());
					selected.setPos(aux.getPos());
				} else {
					playerMusic = new PlayerMusic("sounds/3.mp3");
					playerMusic.play();
				}
				selected = null;
			} catch (CloneNotSupportedException e1) {
				e1.printStackTrace();
			}

		}
		if (validaPuzzle()) {
			JOptionPane.showMessageDialog(this, "Ganhou!");
		}
		repaint();

	}