public void actionPerformed(ActionEvent ae) {
            for (int y = 0; y < 8; y++) {
                for (int x = 0; x < 8; x++) {
                    if (buttons[y][x] == ae.getSource()) {
                        if (!firstChoice) {
                            if (chessBoard.get(x, y) == null || !chess.getUserColor().equals(chessBoard.get(x, y).getColor())) {
                                return;
                            }
                            myXCoor = x;
                            myYCoor = y;
                            firstChoice = true;
                        }
                        else if (!secondChoice) {
                            targXCoor = x;
                            targYCoor = y;
                            secondChoice = true;
                        }
                        System.out.println(x);
                        System.out.println(y);
                    }
                }
            }
            semaphore.release();
        }