public Action getUserInput(final Set<Action> allowedActions) {
    	System.out.println("Here");
        selectedAction = null;
        while (selectedAction == null) {
            // Show the buttons for the allowed actions.
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    removeAll();
                    if (allowedActions.contains(Action.CONTINUE)) {
                        add(btnContinue);
                    } else {
                        if (allowedActions.contains(Action.LEAVE)) {
                            add(btnLeave);
                        }
                        if (allowedActions.contains(Action.SIT)) {
                            add(btnSit);
                        }
                        if (allowedActions.contains(Action.DRAW)) {
                            add(btnDraw);
                        }
                        if (allowedActions.contains(Action.DISCARD)) {
                            add(btnDiscard);
                        }                        
                        if (allowedActions.contains(Action.FOLD)) {
                            add(btnFold);
                        }
                    }
                    repaint();
                }
            });
            
            // Wait for the user to select an action.
            synchronized (monitor) {
                try {
                    monitor.wait();
                } catch (InterruptedException e) {
                    // Ignore.
                }
            }
            

        }
        
        return selectedAction;
    }