private static Window parent() {
    Window activeWindow = null;
    for (Window w : Window.getWindows()) {
      if (w.isActive()) {activeWindow = w;}
    }
    return activeWindow;
  }
private static Window parent()