code: public void actionPerformed(ActionEvent ae) {
  
  		Object source = ae.getSource();
  
  		if (source == cancel_button)
  			onCancel();
  		else if (source == add_button || source == direct_text)
  			onAdd();
  		else if (source == remove_button)
  			onRemove();
  		else if (source == dismiss_button)
  			onDismiss();
  		else if (source == ok_button || source instanceof TextField)
  			onOK();
  	}
docs: /////////////////////////