synchronized (tmp)
AWTEvent ev = queue.getNextEvent();    if (ev instanceof ActiveEvent) ((ActiveEvent) ev).dispatch(); else if (ev.getSource() instanceof Component) ((Component) ev.getSource()).dispatchEvent(ev); else if (ev.getSource() instanceof MenuComponent) ((MenuComponent) ev.getSource()).dispatchEvent(ev);   } else
  private static void startModal(JInternalFrame f)  {    synchronized (f)      {	final JInternalFrame tmp = f;	tmp.toFront();	f.addInternalFrameListener(new InternalFrameAdapter()	    {	      public void internalFrameClosed(InternalFrameEvent e)	      {		synchronized (tmp)		  {		    tmp.removeInternalFrameListener(this);		    tmp.notifyAll();		  }	      }	    });	try	  {	    while (! f.isClosed())	      f.wait();	  }	catch (InterruptedException ignored)	  {          // Ignore this Exception.	  }      }  }