getSource() returns an object and you are trying to compare said object to "Exit", but you don't have any "Exit" objects. However, you do have a bmiExit object, but the scope of that variable...