@Override
  public boolean dispatch(AWTEvent event) {
   if (event instanceof KeyEvent) {
      return dispatchKeyEvent((KeyEvent) event);
   }

   if (event instanceof MouseEvent) {
     return dispatchMouseEvent(event);
   }

   if (event instanceof InputMethodEvent) {
     return dispatchInputMethodEvent((InputMethodEvent) event);
   }

   return false;
  }
@Override
  public boolean dispatch(AWTEvent event)