int index = list.getSelectedIndex();
int index = list.getSelectionModel().getLeadSelectionIndex(); if (index > 0) {
  protected void selectPreviousIndex()  {    int index = list.getSelectedIndex();    index--;    list.setSelectedIndex(index);    list.ensureIndexIsVisible(index);  }