@Override
    public void eventDispatched(AWTEvent event) {
      AWTEventListener listener = myReference.get();
      if (listener != null) {
        listener.eventDispatched(event);
      }
      else {
        Toolkit.getDefaultToolkit().removeAWTEventListener(this);
      }
    }
@Override
    public void eventDispatched(AWTEvent event)