code: public static void closeWindow(Component component) {
  
          Window window = getWindow(component);
          if (window != null) {
              window.close();
          }
      }
docs: Closes the window containing the given component.
  
  @param component a component