int index = list.getSelectedIndex();
int index = list.getSelectionModel().getLeadSelectionIndex(); if (index < list.getModel().getSize() - 1) {
  protected void selectNextIndex()  {    int index = list.getSelectedIndex();    index++;    list.setSelectedIndex(index);    list.ensureIndexIsVisible(index);  }