private static @Nullable Point getLocationOnScreen(@Nullable Component component) {
    return component == null || !component.isShowing() ? null : component.getLocationOnScreen();
  }
private static @Nullable Point getLocationOnScreen(@Nullable Component component)