public void actionPerformed(ActionEvent e){ if (e.getActionCommand().equals("Yes") { //the user pressed "Yes"; do something ... } }