src/main/java/com/spinyowl/legui/component/SelectBox.java
public void removeElement(int index) {
    lock.lock();
    try {
      if (!elements.isEmpty()) {
        T s = elements.get(index);
        elements.remove(index);
        SelectBoxElement<T> element = selectBoxElements.get(index);
        selectBoxElements.remove(index);
        selectionListPanel.getContainer().remove(element);
        for (int i = index; i < selectBoxElements.size(); i++) {
          selectBoxElements.get(i).getPosition().y -= elementHeight;
        }
        if (selectedElement == s) {
          setSelected(0, true);
        }
      }
    } finally {
      lock.unlock();
    }
  }
/**
   * Used to remove element on specified index from selectbox.
   *
   * @param index index of element to remove from selectbox.
   */
Used to remove element on specified index from selectbox.
@param index index of element to remove from selectbox.
Used to remove element on specified index from selectbox . @param index index of element to remove from selectbox .
public void removeElement(int index) {
    lock.lock();
    try {
      if (!elements.isEmpty()) {
        T s = elements.get(index);
        elements.remove(index);
        SelectBoxElement<T> element = selectBoxElements.get(index);
        selectBoxElements.remove(index);
        selectionListPanel.getContainer().remove(element);
        for (int i = index; i < selectBoxElements.size(); i++) {
          selectBoxElements.get(i).getPosition().y -= elementHeight;
        }
        if (selectedElement == s) {
          setSelected(0, true);
        }
      }
    } finally {
      lock.unlock();
    }
  }
public void removeElement ( int index ) { lock . lock ( ) ; try { if ( ! elements . isEmpty ( ) ) { T s = elements . get ( index ) ; elements . remove ( index ) ; SelectBoxElement < T > element = selectBoxElements . get ( index ) ; selectBoxElements . remove ( index ) ; selectionListPanel . getContainer ( ) . remove ( element ) ; for ( int i = index ; i < selectBoxElements . size ( ) ; i ++ ) { selectBoxElements . get ( i ) . getPosition ( ) . y -= elementHeight ; } if ( selectedElement == s ) { setSelected ( 0 , true ) ; } } } finally { lock . unlock ( ) ; } }
Used to remove element on specified index from selectbox.
Used to remove element on specified index from selectbox .