public boolean handleEvent (Event event) {
    if ((event.id == Event.WINDOW_DESTROY) ||
        (event.id == Event.KEY_PRESS && event.key == 0x1b) ||
	(event.id == Event.ACTION_EVENT && event.target == cancelButton)) 
    {
      hide();
      dispose();
    }
    else if (event.id == Event.ACTION_EVENT && event.target == okayButton) {
      hide();
      dispose();
      try {
        pa.waveCanvas.amplify (
	                Double.valueOf (factorField.getText()).doubleValue());
      }
      catch (Exception e) { new ExceptionDialog (pa, e).show(); }
    }
    else return super.handleEvent (event);
    return true;
  }