code: public static void centerWindow(Component component) {
  
          Window window = getWindow(component);
          if (window != null) {
              window.center();
          }
      }
docs: Centers the parent window of given component.<p>
  
  @param component Component as child of window