synchronized (ownedWindows)
synchronized (getTreeLock ())
  public void dispose()  {    hide();    synchronized (ownedWindows)      {	Iterator e = ownedWindows.iterator();	while(e.hasNext())	  {	    Window w = (Window)(((Reference) e.next()).get());	    if (w != null)	      w.dispose();	    else	      // Remove null weak reference from ownedWindows.	      e.remove();	  }      }    for (int i = 0; i < ncomponents; ++i)      component[i].removeNotify();    this.removeNotify();  }