else
  public static Component getRoot(Component comp)  {    Applet app = null;    Window win = null;    while (comp != null)      {        if (win == null && comp instanceof Window)          win = (Window) comp;        else if (comp instanceof Applet)          app = (Applet) comp;        comp = comp.getParent();      }    if (win != null)      return win;    else      return app;  }