public static <T> boolean isPointOnSelection(@NotNull JList<T> list, int x, int y) {
    int row = list.locationToIndex(new Point(x, y));
    if (row < 0) return false;
    return list.isSelectedIndex(row);
  }
public static <T> boolean isPointOnSelection(@NotNull JList<T> list, int x, int y)