target.dispatchEvent (e);
redispatchEvent(target, e);
  public boolean dispatchEvent (AWTEvent e)  {    if (e instanceof WindowEvent)      {        Window target = (Window) e.getSource ();        if (e.id == WindowEvent.WINDOW_ACTIVATED)          setGlobalActiveWindow (target);        else if (e.id == WindowEvent.WINDOW_GAINED_FOCUS)          setGlobalFocusedWindow (target);        else if (e.id != WindowEvent.WINDOW_LOST_FOCUS                 && e.id != WindowEvent.WINDOW_DEACTIVATED)          return false;        target.dispatchEvent (e);        return true;      }    else if (e instanceof FocusEvent)      {        Component target = (Component) e.getSource ();        if (e.id == FocusEvent.FOCUS_GAINED)          {            if (((FocusEvent) e).isTemporary ())              setGlobalFocusOwner (target);            else              setGlobalPermanentFocusOwner (target);          }        else if (e.id == FocusEvent.FOCUS_LOST)          {            // We need to set the window's focus owner here; we can't            // set it when the window loses focus because by that time            // the previous focus owner has already lost focus            // (FOCUS_LOST events are delivered before            // WINDOW_LOST_FOCUS events).            // Find the target Component's top-level ancestor.            Container parent = target.getParent ();            while (parent != null                   && !(parent instanceof Window))              parent = parent.getParent ();            Window toplevel = parent == null ?              (Window) target : (Window) parent;            Component focusOwner = getFocusOwner ();            if (focusOwner != null)              toplevel.setFocusOwner (focusOwner);            if (((FocusEvent) e).isTemporary ())              setGlobalFocusOwner (null);            else              setGlobalPermanentFocusOwner (null);          }          target.dispatchEvent (e);        return true;      }    else if (e instanceof KeyEvent)      {        // Loop through all registered KeyEventDispatchers, giving        // each a chance to handle this event.        Iterator i = getKeyEventDispatchers().iterator();        while (i.hasNext ())          {            KeyEventDispatcher dispatcher = (KeyEventDispatcher) i.next ();            if (dispatcher.dispatchKeyEvent ((KeyEvent) e))              return true;          }        // processKeyEvent checks if this event represents a focus        // traversal key stroke.        Component focusOwner = getGlobalPermanentFocusOwner ();        if (focusOwner != null)        processKeyEvent (focusOwner, (KeyEvent) e);        if (e.isConsumed ())          return true;        if (enqueueKeyEvent ((KeyEvent) e))          // This event was enqueued for dispatch at a later time.          return true;        else          // This event wasn't handled by any of the registered          // KeyEventDispatchers, and wasn't enqueued for dispatch          // later, so send it to the default dispatcher.          return dispatchKeyEvent ((KeyEvent) e);      }    return false;  }