Esempio n. 1
0
  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);
    }
  }
Esempio n. 2
0
 /**
  * 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);
 }
Esempio n. 3
0
  /**
   * 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);
  }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 5
0
 public void remove(int position) {
   awtList.remove(position);
   projects.remove(position);
 }