void applyFrom(@NotNull Window window) {
    if (window.isVisible()) {
      boolean windowFullScreen = isFullScreen(window);
      setFullScreen(windowFullScreen);

      Frame frame = window instanceof Frame ? (Frame)window : null;
      int windowExtendedState = frame == null ? Frame.NORMAL : frame.getExtendedState();
      setExtendedState(windowExtendedState);

      if (!windowFullScreen && windowExtendedState == Frame.NORMAL) {
        setLocation(window.getLocation());
        setSize(window.getSize());
      }
    }
  }
void applyFrom(@NotNull Window window)