Iterator i = keyEventDispatchers.iterator ();
Iterator i = getKeyEventDispatchers().iterator();
  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            && !(target instanceof Window))          {            if (((FocusEvent) e).isTemporary ())              setGlobalFocusOwner (target);            else              setGlobalPermanentFocusOwner (target);          }        if (!(target instanceof Window))          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 = keyEventDispatchers.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 ();        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;  }