if (peekEvent() == null && ((ClasspathToolkit) Toolkit.getDefaultToolkit()).nativeQueueEmpty())
if (peekEvent() == null)
  synchronized boolean isShutdown ()  {    if (shutdown)      return true;    // This is the exact self-shutdown condition specified in J2SE:    // http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/AWTThreadIssues.html        if (peekEvent() == null        && ((ClasspathToolkit) Toolkit.getDefaultToolkit()).nativeQueueEmpty())      {        Frame[] frames = Frame.getFrames();        for (int i = 0; i < frames.length; ++i)          if (frames[i].isDisplayable())            return false;        return true;      }    return false;  }