EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();   while (eq.next != null) eq = eq.next;
  public static boolean isDispatchThread()  {    EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();     return (Thread.currentThread() == eq.dispatchThread);  }