appendix> Component> JComboBox | TOPUPPREVNEXT |
J2SE 1.4以降であれば、 ドロップダウンせずにその場で選択する スピナ というコンポーネントも使えます。
メソッド | 機能 |
---|---|
JComboBox(Object[ ] items ) | items を要素とするコンボボックスを生成します。 |
メソッド | 機能 |
---|---|
void addActionListener ( ActionListener a ) | |
void addItem ( Object obj ) | |
void addItemListener ( ItemListener i ) | |
void addPopupMenuListener ( PopupMenuListener p ) | |
Action getAction ( ) | |
String getActionCommand ( ) | |
Object getItem ( int index ) | |
int getItemCount ( ) | |
int getMaximumRowCount ( ) | |
int getSelectedIndex ( ) | |
Object getSelectedItem ( ) | |
Object[] getSelectedObjects ( ) | |
void hidePopup ( ) | |
void insertItemAt ( Object obj , int ind ) | |
boolean isEditable ( ) | |
void setAction ( Action a ) | |
void setActionCommand ( String s ) | |
void setEditable ( boolean e ) | |
void setEnabled ( boolean e ) | |
void setKeySelectionManager ( JComboBox.KeySelectionManager k ) | |
void setMaximumRowCount ( int m ) | |
void setPopupVisible ( boolean v ) | |
void setSelectedIndex ( int ind ) | |
void setSelectedItem ( Object obj ) |
実行結果
実行直後 | カーソルを入れ BS や DEL で文字を消し 編集をします Enter で確定します |
編集後のプルダウンは 変わりません |
更新日:2006-01-20