| 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
javax.swing.DefaultComboBoxModel
public class DefaultComboBoxModel
组合框的默认模型。
| 字段摘要 | 
|---|
| 从类 javax.swing.AbstractListModel 继承的字段 | 
|---|
listenerList | 
| 构造方法摘要 | |
|---|---|
DefaultComboBoxModel()
构造一个空的 DefaultComboBoxModel 对象。  | 
|
DefaultComboBoxModel(Object[] items)
构造一个用对象数组初始化的 DefaultComboBoxModel 对象。  | 
|
DefaultComboBoxModel(Vector<?> v)
构造一个用向量初始化的 DefaultComboBoxModel 对象。  | 
|
| 方法摘要 | |
|---|---|
 void | 
addElement(Object anObject)
在模型的末尾添加项。  | 
 Object | 
getElementAt(int index)
返回指定索引处的值。  | 
 int | 
getIndexOf(Object anObject)
返回指定对象在列表中的索引位置。  | 
 Object | 
getSelectedItem()
返回选择的项  | 
 int | 
getSize()
返回列表的长度。  | 
 void | 
insertElementAt(Object anObject,
                int index)
在指定索引处添加项。  | 
 void | 
removeAllElements()
清空列表。  | 
 void | 
removeElement(Object anObject)
从模型中移除项。  | 
 void | 
removeElementAt(int index)
在指定索引处移除项。  | 
 void | 
setSelectedItem(Object anObject)
设置选择项的值。  | 
| 从类 javax.swing.AbstractListModel 继承的方法 | 
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener | 
| 从类 java.lang.Object 继承的方法 | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 从接口 javax.swing.ListModel 继承的方法 | 
|---|
addListDataListener, removeListDataListener | 
| 构造方法详细信息 | 
|---|
public DefaultComboBoxModel()
public DefaultComboBoxModel(Object[] items)
items - Object 对象数组public DefaultComboBoxModel(Vector<?> v)
v - 一个 Vector 对象| 方法详细信息 | 
|---|
public void setSelectedItem(Object anObject)
ComboBoxModel 中的 setSelectedItemanObject - 组合框值,如果没有选择任何对象,则该参数为 null。public Object getSelectedItem()
ComboBoxModel 复制的描述
ComboBoxModel 中的 getSelectedItemnullpublic int getSize()
ListModel 复制的描述
ListModel 中的 getSizepublic Object getElementAt(int index)
ListModel 复制的描述
ListModel 中的 getElementAtindex - 请求的索引
index 处的值public int getIndexOf(Object anObject)
anObject - 
public void addElement(Object anObject)
MutableComboBoxModel 复制的描述ListDataListener。
MutableComboBoxModel 中的 addElementanObject - 要添加的 Object
public void insertElementAt(Object anObject,
                            int index)
MutableComboBoxModel 复制的描述ListDataListener。
MutableComboBoxModel 中的 insertElementAtanObject - 要添加的 Objectindex - 添加对象的位置public void removeElementAt(int index)
MutableComboBoxModel 复制的描述ListDataListener。
MutableComboBoxModel 中的 removeElementAtindex - 要移除对象的位置public void removeElement(Object anObject)
MutableComboBoxModel 复制的描述ListDataListener。
MutableComboBoxModel 中的 removeElementanObject - 要移除的 Objectpublic void removeAllElements()
  | 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。