void (@NotNull JList<?> list) { int visible = getVisibleRowCount(list); if (visible <= 0) { moveEnd(list); return; } int size = list.getModel().getSize(); int increment = visible - 1; int index = Math.min(list.getSelectedIndex() + increment, size - 1); int top = list.getFirstVisibleIndex() + increment; int bottom = top + visible - 1; if (bottom >= size) { bottom = size - 1; } //list.clearSelection(); Rectangle cellBounds = list.getCellBounds(top, bottom); if (cellBounds == null) { moveEnd(list); return; } list.scrollRectToVisible(cellBounds); list.setSelectedIndex(index); list.ensureIndexIsVisible(index); }