public BrainConfirmationDialog()
    {
        setResizable(false);
        setModal(true);

        contentPane.setBorder(DefaultUIProvider.getDefaultEmptyEtchedEmptyBorder());

        setContentPane(contentPane);
        getRootPane().setDefaultButton(correctButton);

        correctButton.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                onCorrect();
            }
        });

        incorrectButton.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                onIncorrect();
            }
        });

// call onIncorrect() when cross is clicked
        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter()
        {
            public void windowClosing(WindowEvent e)
            {
                onIncorrect();
            }
        });

// call onIncorrect() on LEFT
        contentPane.registerKeyboardAction(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                onCorrect();
            }
        }, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);

// call onIncorrect() on RIGHT
        contentPane.registerKeyboardAction(new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
                onIncorrect();
            }
        }, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
    }