code: public static boolean isParentWindowFocused(Component component) {
          Window window = SwingUtilities.getWindowAncestor(component);
  
          return window != null && window.isFocused();
      }
docs: {@code true} if the given {@link Component}'s parent {@link Window} is
  currently active (focused).
  
  @param  component the {@code Component} to check the parent
  {@code Window}'s focus for.
  
  @return {@code true} if the given {@code Component}'s parent
  {@code Window} is currently active.