if(e.getActionCommand().equals("done")) {
if (e.getSource() == butOkay) {
    public void actionPerformed(ActionEvent e) {        if(e.getActionCommand().equals("done")) {            try {                xvalue = Integer.decode(xT.getText()).intValue();                yvalue = Integer.decode(yT.getText()).intValue();                selected = defaultC.getSelectedIndex();            } catch(NumberFormatException ex) {                System.err.println(ex.getMessage());            }            setVisible(false);        }        if(e.getActionCommand().equals("cancel")) {            setVisible(false);        }    }