public static void setEnabledFor(@Nullable Window window, boolean enabled) {
    JRootPane root = getRootPane(window);
    if (root != null) root.putClientProperty(NO_WINDOW_ACTIONS, !enabled);
  }
public static void setEnabledFor(@Nullable Window window, boolean enabled)