private static boolean isUnder(@NotNull Component component, Component parent) {
      while (component != null) {
        if (component == parent) return true;
        component = component.getParent();
      }
      return false;
    }
private static boolean isUnder(@NotNull Component component, Component parent)