public synchronized void remove(String item){
  int index=items.indexOf(item);
  if (index < 0) {
    throw new IllegalArgumentException("item " + item + " not found in list");
  }
 else {
    remove(index);
  }
}

public synchronized void remove ( String item ) { int index = items . indexOf ( item ) ; if ( index < 0 ) { throw new IllegalArgumentException ( "item " + item + " not found in list" ) ; } else { remove ( index ) ; } }
removes the first occurrence of an item from the list . if the specified item is selected , and is the only selected item in the list , the list is set to have no selection .
