selectedItem = getElementAt(selected - 1);
setSelectedItem(getElementAt(selected - 1));
  public void removeElementAt(int index)  {    int selected = getIndexOf(selectedItem);    if (selected == index) // choose a new selected item      {        if (selected > 0)          selectedItem = getElementAt(selected - 1);        else           selectedItem = getElementAt(selected + 1);      }    list.removeElementAt(index);    fireIntervalRemoved(this, index, index);  }