private static int getVisibleRowCount(@NotNull JList<?> list) {
    return list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1;
  }
private static int getVisibleRowCount(@NotNull JList<?> list)