E - 这个模型的元素的类型 
       public class DefaultComboBoxModel<E> extends AbstractListModel<E> implements MutableComboBoxModel<E>, Serializable
listenerList| Constructor and Description | 
|---|
| DefaultComboBoxModel()
              构造一个空的DefaultComboBoxModel对象。 
             | 
| DefaultComboBoxModel(E[] items)
              构造一个使用对象数组初始化的DefaultComboBoxModel对象。 
             | 
| DefaultComboBoxModel(Vector<E> v)
              构造一个使用向量初始化的DefaultComboBoxModel对象。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addElement(E anObject)
              在模型的末尾添加一个项目。 
             | 
| E | getElementAt(int index)
              返回指定索引处的值。 
             | 
| int | getIndexOf(Object anObject)
              返回列表中指定对象的索引位置。 
             | 
| Object | getSelectedItem()
              返回所选项目 
             | 
| int | getSize()
              返回列表的长度。 
             | 
| void | insertElementAt(E anObject, int index)
              在特定索引中添加项目。 
             | 
| void | removeAllElements()
              清空清单。 
             | 
| void | removeElement(Object anObject)
              从模型中删除一个项目。 
             | 
| void | removeElementAt(int index)
              删除特定索引处的项目。 
             | 
| void | setSelectedItem(Object anObject)
              设置所选项目的值。 
             | 
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListDataListener, removeListDataListenerpublic DefaultComboBoxModel()
public DefaultComboBoxModel(E[] items)
items - 一个Object对象数组 
           public void setSelectedItem(Object anObject)
setSelectedItem在界面 
            ComboBoxModel<E> 
           anObject - 组合框值或无选择的空值。 
           public Object getSelectedItem()
ComboBoxModel复制 
          getSelectedItem在界面 
            ComboBoxModel<E> 
           null如果没有选择 
           public int getSize()
ListModel 
          public E getElementAt(int index)
ListModel复制 
          getElementAt在界面 
            ListModel<E> 
           index - 请求的索引 
           index 
           public int getIndexOf(Object anObject)
anObject - 
           public void addElement(E anObject)
MutableComboBoxModel 
          ListDataListener该项目已被添加。 
          addElement在界面 
            MutableComboBoxModel<E> 
           anObject - 要添加的项目 
           public void insertElementAt(E anObject, int index)
MutableComboBoxModel复制 
          ListDataListener该项目已被添加。 
          insertElementAt在界面 
            MutableComboBoxModel<E> 
           anObject - 要添加的项目 
           index - 添加对象的位置 
           public void removeElementAt(int index)
MutableComboBoxModel复制 
          ListDataListener该项目已被删除。 
          removeElementAt中的 
            MutableComboBoxModel<E> 
           index - 要删除的项目的位置 
           public void removeElement(Object anObject)
MutableComboBoxModel复制 
          ListDataListener该项目已被删除。 
          removeElement在界面 
            MutableComboBoxModel<E> 
           anObject - 要删除的 
            Object 
           public void removeAllElements()
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.