public void actionPerformed(ActionEvent e){
  try {
    setValue(e.getActionCommand());
  }
 catch (  NumberFormatException e1) {
    setValue(StringTextField.this.value);
  }
}

public void actionPerformed ( ActionEvent e ) { try { setValue ( e . getActionCommand ( ) ) ; } catch ( NumberFormatException e1 ) { setValue ( StringTextField . this . value ) ; } }
reacts to somebody pressing the return key in this field by attempting to set the value displayed . if the value displayed cannot be set , the set value is reinstated .
