private static void _ensureRangeIsVisible(@NotNull JComponent c, int top, int bottom) {
    if (c instanceof JList) {
      ensureRangeIsVisible((JList<?>)c, top, bottom);
    }
    else if (c instanceof JTable table) {
      Rectangle cellBounds = getCellBounds(table, top, bottom);
      cellBounds.x = 0;
      table.scrollRectToVisible(cellBounds);
    }
  }
private static void _ensureRangeIsVisible(@NotNull JComponent c, int top, int bottom)