private static void scrollToVisible(@NotNull JComponent parent,
                                      @NotNull Rectangle bounds) {
    if (!parent.getVisibleRect().contains(bounds)) {
      parent.scrollRectToVisible(bounds);
    }
  }
private static void scrollToVisible(@NotNull JComponent parent,
                                      @NotNull Rectangle bounds)