private void passAllNames(List listaA, List listaB) { String item = ""; int numItens = listaA.getItemCount(); for (int i = 0; i < numItens; i++) { item = listaA.getItem(0); listaB.add(item); listaA.remove(item); } }
/** * Replaces the item at the specified index with the specified item. * * @param item The new item value. * @param index The index of the item to replace. * @exception IllegalArgumentException If the index is not valid. */ public synchronized void replaceItem(String item, int index) throws IllegalArgumentException { remove(index); addItem(item, index); }
/** * Deletes the first occurrence of the specified item from the list. * * @param item The item to delete. * @exception IllegalArgumentException If the specified item does not exist. */ public synchronized void remove(String item) throws IllegalArgumentException { int index = items.indexOf(item); if (index == -1) throw new IllegalArgumentException("List element to delete not found"); remove(index); }
/** * Deletes the item at the specified index. * * @param index The index of the item to delete. * @exception IllegalArgumentException If the index is not valid */ public void delItem(int index) throws IllegalArgumentException { remove(index); }
public void remove(int position) { awtList.remove(position); projects.remove(position); }