/** * Removes the component at the specified index from this popup menu. * * @param pos the position of the item to be removed * @exception IllegalArgumentException if the value of <code>pos</code> < 0, or if the value of * <code>pos</code> is greater than the number of items */ public void remove(int pos) { if (pos < 0) { throw new IllegalArgumentException("index less than zero."); } if (pos > getComponentCount() - 1) { throw new IllegalArgumentException("index greater than the number of items."); } super.remove(pos); }