|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
public class JComboBox
¹öư, ¶Ç´Â ÆíÁý °¡´É Çʵå¿Í µå·Ó ´Ù¿î ¸®½ºÆ®¸¦ Á¶ÇÕÇÑ ÄÄÆÛ³ÍÆ®ÀÔ´Ï´Ù. »ç¿ëÀÚ´Â ¿ä±¸¿¡ ÀÀÇØ Ç¥½ÃµÇ´Â µå·Ó ´Ù¿î ¸®½ºÆ®·ÎºÎÅÍ °ªÀ» ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. combobox¸¦ ÆíÁý °¡´ÉÇÏ°Ô Çϸé, ÆíÁý °¡´ÉÇÑ Çʵ带 °¡Áö°Ô µÇ¾î, »ç¿ëÀÚ°¡ °ªÀ» ÀÚÀ¯·Ó°Ô ÀÔ·ÂÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù.
Ç¥ÁØÀÇ Look & Feel (L&F) Ç¥ÇöÀ¸·Î ÀÌ ÄÄÆÛ³ÍÆ®°¡ »ç¿ëÇϴ Űº¸µåÀÇ Å°¿¡ ´ëÇØ¼´Â ¡¸JComboBox
ÀÇ Å°ÀÇ ÇҴ硹À» ÂüÁ¶ÇϽʽÿÀ.
°æ°í: ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ °´Ã¼´Â ÇâÈÄÀÇ Swing ¸±¸®Áî¿Í
ȣȯµÇÁö ¾ÊÀ» ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈÀÇ Áö¿øÀº
´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÀüÀÇ Swing¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. JDK ¹öÀü
1.4 ÀÌÈÄ, ¸ðµç JavaBeans™
Àå±â°£ÀÇ ¿î¿ë Áö¿øÀº
java.beans
ÆÐŰÁö¿¡ Ãß°¡µÇ°í ÀÖ½À´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº XMLEncoder
¸¦
ÂüÁ¶ÇϽʽÿÀ.
ÀÚ¼¼ÇÑ °ÍÀº ¡¸The Java Tutorial¡¹ ¡¸How to Use Combo Boxes¡¹¸¦ ÂüÁ¶ÇϽʽÿÀ.
ComboBoxModel
,
DefaultComboBoxModel
Áßø(Nested) Ŭ·¡½º °³¿ä | |
---|---|
protected class |
JComboBox.AccessibleJComboBox
ÀÌ Å¬·¡½º´Â JComboBox Ŭ·¡½º¿ëÀÇ »ç¿ëÀÚ
º¸Á¶ ±â´ÉÀÇ Áö¿ø¸¦ ±¸ÇöÇϰí ÀÖ½À´Ï´Ù. |
static interface |
JComboBox.KeySelectionManager
KeySelectionManager ¸¦ Á¤ÀÇÇÏ´Â ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. |
Ŭ·¡½º javax.swing. JComponent ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
JComponent.AccessibleJComponent |
Ŭ·¡½º java.awt. Container ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
Container.AccessibleAWTContainer |
Ŭ·¡½º java.awt. Component ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
Component.AccessibleAWTComponent,
Component.BltBufferStrategy,
Component.FlipBufferStrategy |
ÇÊµå °³¿ä | |
---|---|
protected String |
actionCommand
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected ComboBoxModel |
dataModel
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected ComboBoxEditor |
editor
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected boolean |
isEditable
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected JComboBox.KeySelectionManager |
keySelectionManager
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected boolean |
lightWeightPopupEnabled
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected int |
maximumRowCount
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected ListCellRenderer |
renderer
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
protected Object |
selectedItemReminder
ÀÌ protected Çʵå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
Ŭ·¡½º javax.swing. JComponent ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
---|
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Ŭ·¡½º java.awt. Component ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
---|
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
ÀÎÅÍÆäÀ̽º java.awt.image. ImageObserver ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
---|
ABORT,
ALLBITS,
ERROR,
FRAMEBITS,
HEIGHT,
PROPERTIES,
SOMEBITS,
WIDTH |
»ý¼ºÀÚ °³¿ä | |
---|---|
JComboBox ()
µðÆúÆ®ÀÇ µ¥ÀÌÅÍ ¸ðµ¨·Î JComboBox ¸¦ »ý¼ºÇÕ´Ï´Ù. |
|
JComboBox (ComboBoxModel aModel)
Ç׸ñÀ» ±âÁ¸ÀÇ ComboBoxModel ·Î
ºÎÅÍ ¾ò´Â JComboBox ¸¦ »ý¼ºÇÕ´Ï´Ù. |
|
JComboBox (Object [] items)
ÁöÁ¤µÈ ¹è¿¿¡ ¿ä¼Ò¸¦ Æ÷ÇÔÇÏ´Â JComboBox ¸¦ »ý¼ºÇÕ´Ï´Ù. |
|
JComboBox (Vector <? > items)
ÁöÁ¤µÈ Vector¿¡ ¿ä¼Ò¸¦ Æ÷ÇÔÇÏ´Â JComboBox ¸¦ »ý¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
void |
actionPerformed (ActionEvent e)
ÀÌ ¸Þ¼µå´Â public°¡ µÇ¾î ÀÖ½À´Ï´Ù¸¸, À̰ÍÀº ±¸ÇöÀÇ ºÎÀÛ¿ë¿¡ ÇÏ´Â °ÍÀÔ´Ï´Ù. |
void |
addActionListener (ActionListener l)
ActionListener ¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
addItem (Object anObject)
Ç׸ñÀ» Ç׸ñ ¸®½ºÆ®¿¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addItemListener (ItemListener aListener)
ItemListener ¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
addPopupMenuListener (PopupMenuListener l)
comboboxÀÇ pop-up·ÎºÎÅÍ ÅëÁö ¸Þ¼¼Áö¸¦ ¹Þ¾ÆµéÀÌ´Â PopupMenu ¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
configureEditor (ComboBoxEditor anEditor,
Object anItem)
ÁöÁ¤µÈ Ç׸ñÀ¸·Î ¿¡µðÅ͸¦ ÃʱâÈÇÕ´Ï´Ù. |
protected void |
configurePropertiesFromAction (Action a)
Action ÀνºÅϽºÀÇ °ª¿¡ µû¶ó ActionEvent ¼Ò½ºÀÇ ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÏ´Â ÆÑÅ丮 ¸Þ¼µåÀÔ´Ï´Ù. |
void |
contentsChanged (ListDataEvent e)
ÀÌ ¸Þ¼µå´Â public°¡ µÇ¾î ÀÖ½À´Ï´Ù¸¸, À̰ÍÀº ±¸ÇöÀÇ ºÎÀÛ¿ë¿¡ ÇÏ´Â °ÍÀÔ´Ï´Ù. |
protected PropertyChangeListener |
createActionPropertyChangeListener (Action a)
ActionEvent ¼Ò½º¸¦ Action ÀνºÅϽºÀÇ ÇÁ·ÎÆÛƼÀÇ º¯°æ¿¡ µû¶ó °»½ÅÇϱâ À§Çؼ »ç¿ëÇÏ´Â PropertyChangeListener ¸¦ »ý¼ºÇÏ´Â ÆÑÅ丮 ¸Þ¼µåÀÔ´Ï´Ù. |
protected JComboBox.KeySelectionManager |
createDefaultKeySelectionManager ()
µðÆúÆ®ÀÇ Å° ¼±Åà ¸Å´ÏÀúÀÇ ÀνºÅϽº¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
protected void |
fireActionEvent ()
ÅëÁöÀÇ Àü´Þ ´ë»óÀ» ÁöÁ¤µÈ À̺¥Æ®ÇüÀ¸·Î µî·ÏÇÑ ¸ðµç ¸®½º³Ê¿¡°Ô ÅëÁöÇÕ´Ï´Ù. |
protected void |
fireItemStateChanged (ItemEvent e)
ÅëÁöÀÇ Àü´Þ ´ë»óÀ» ÁöÁ¤µÈ À̺¥Æ®ÇüÀ¸·Î µî·ÏÇÑ ¸ðµç ¸®½º³Ê¿¡°Ô ÅëÁöÇÕ´Ï´Ù. |
void |
firePopupMenuCanceled ()
comboboxÀÇ pop-up ºÎºÐÀÌ »èÁ¦µÈ °ÍÀ» PopupMenuListener ¿¡ ÅëÁöÇÕ´Ï´Ù. |
void |
firePopupMenuWillBecomeInvisible ()
comboboxÀÇ pop-up ºÎºÐÀÌ ºÒ°¡½Ã »óŰ¡ µÈ °ÍÀ» PopupMenuListener ¿¡ ÅëÁöÇÕ´Ï´Ù. |
void |
firePopupMenuWillBecomeVisible ()
comboboxÀÇ pop-up ºÎºÐÀÌ °¡½Ã »óŰ¡ µÈ °ÍÀ» PopupMenuListener ¿¡ ÅëÁöÇÕ´Ï´Ù. |
AccessibleContext |
getAccessibleContext ()
ÀÌ JComboBox¿¡ °ü·ÃµÈ AccessibleContext¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Action |
getAction ()
ÀÌ ActionEvent ¼Ò½º¿¡ ÇöÀç ¼³Á¤µÇ¾î ÀÖ´Â Action À»
¸®ÅÏÇÕ´Ï´Ù. |
String |
getActionCommand ()
¾×¼Ç ¸®½º³Ê¿¡°Ô º¸³»Áö´Â À̺¥Æ®¿¡ Æ÷ÇԵǾî ÀÖ´Â ¾×¼Ç Ä¿¸àµå¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
ActionListener [] |
getActionListeners ()
addActionListener()·Î ÀÌ JComboBox¿¡ Ãß°¡µÇ´Â ¸ðµç ActionListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
ComboBoxEditor |
getEditor ()
¼±ÅÃµÈ Ç׸ñÀ» JComboBox Çʵ忡¼ ·»´õ¸µ ¹× ÆíÁýÇϱâ À§Çؼ »ç¿ëÇÏ´Â ¿¡µðÅ͸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Object |
getItemAt (int index)
ÁöÁ¤µÈ À妽ºÀÇ ¸®½ºÆ® Ç׸ñÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getItemCount ()
¸®½ºÆ®³»ÀÇ Ç׸ñÀÇ ¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
ItemListener [] |
getItemListeners ()
addItemListener()·Î ÀÌ JComboBox¿¡ Ãß°¡µÇ´Â ¸ðµç ItemListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
JComboBox.KeySelectionManager |
getKeySelectionManager ()
¸®½ºÆ®ÀÇ Å° ¼±Åà ¸Å´ÏÀú¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getMaximumRowCount ()
combobox°¡ ½ºÅ©·Ñ ¹Ù¸¦ »ç¿ëÇÏÁö ¾Ê°í Ç¥½ÃÇÒ ¼ö ÀÖ´Â ÃÖ´ëÀÇ Ç׸ñ¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
ComboBoxModel |
getModel ()
JComboBox ¿¡ ÀÇÇØ ÇöÀç »ç¿ëµÇ°í ÀÖ´Â µ¥ÀÌÅÍ ¸ðµ¨À» ¸®ÅÏÇÕ´Ï´Ù. |
PopupMenuListener [] |
getPopupMenuListeners ()
addPopupMenuListener()·Î ÀÌ JComboBox¿¡ Ãß°¡µÇ´Â ¸ðµç PopupMenuListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
Object |
getPrototypeDisplayValue ()
Ç¥½ÃÀÇ ³ôÀÌ ¹× ÆøÀÇ °è»ê¿¡ »ç¿ëµÇ´Â °´Ã¼ÀÎ ¡¸Ç¥½Ã prototype¡¹Ä¡¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
ListCellRenderer |
getRenderer ()
¼±ÅÃµÈ Ç׸ñÀ» JComboBox Çʵ忡¼ Ç¥½ÃÇϱâ À§Çؼ »ç¿ëµÇ´Â ·»´õ¸µÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getSelectedIndex ()
ÁöÁ¤µÈ Ç׸ñ¿¡ ÀÏÄ¡ÇÏ´Â ¸®½ºÆ®³»ÀÇ ÃÖÃÊÀÇ Ç׸ñÀ» ¸®ÅÏÇÕ´Ï´Ù. |
Object |
getSelectedItem ()
ÇöÀç ¼±Åõǰí ÀÖ´Â Ç׸ñÀ» ¸®ÅÏÇÕ´Ï´Ù. |
Object [] |
getSelectedObjects ()
¼±Åõǰí ÀÖ´Â Ç׸ñÀ» Æ÷ÇÔÇÑ ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
ComboBoxUI |
getUI ()
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ ·»´õ¸µ ÇÏ´Â L&F °´Ã¼¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
String |
getUIClassID ()
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ ·»´õ¸µ ÇÏ´Â L&F Ŭ·¡½ºÀÇ À̸§À» ¸®ÅÏÇÕ´Ï´Ù. |
void |
hidePopup ()
combobox¿¡ pop-up À©µµ¿ì¸¦ ´Ý°Ô ÇÕ´Ï´Ù. |
void |
insertItemAt (Object anObject,
int index)
Ç׸ñÀ» Ç׸ñ ¸®½ºÆ®ÀÇ À妽º·Î ÁöÁ¤µÈ À§Ä¡¿¡ Ãß°¡ÇÕ´Ï´Ù. |
protected void |
installAncestorListener ()
|
void |
intervalAdded (ListDataEvent e)
ÀÌ ¸Þ¼µå´Â public°¡ µÇ¾î ÀÖ½À´Ï´Ù¸¸, À̰ÍÀº ±¸ÇöÀÇ ºÎÀÛ¿ë¿¡ ÇÏ´Â °ÍÀÔ´Ï´Ù. |
void |
intervalRemoved (ListDataEvent e)
ÀÌ ¸Þ¼µå´Â public°¡ µÇ¾î ÀÖ½À´Ï´Ù¸¸, À̰ÍÀº ±¸ÇöÀÇ ºÎÀÛ¿ë¿¡ ÇÏ´Â °ÍÀÔ´Ï´Ù. |
boolean |
isEditable ()
JComboBox °¡ ÆíÁý °¡´ÉÇÑ °æ¿ì´Â true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isLightWeightPopupEnabled ()
lightWeightPopupEnabled ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
isPopupVisible ()
pop-upÀÇ °¡½Ã¼ºÀ» ÆÇÁ¤ÇÕ´Ï´Ù. |
protected String |
paramString ()
ÀÌ JComboBox
ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. |
void |
processKeyEvent (KeyEvent e)
Tab ۸¦ ãÀ¸¸é¼, KeyEvent ¸¦ ó¸®ÇÕ´Ï´Ù. |
void |
removeActionListener (ActionListener l)
ActionListener ¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeAllItems ()
Ç׸ñ ¸®½ºÆ®·ÎºÎÅÍ ¸ðµç Ç׸ñÀ» »èÁ¦ÇÕ´Ï´Ù. |
void |
removeItem (Object anObject)
Ç׸ñÀ» Ç׸ñ ¸®½ºÆ®·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeItemAt (int anIndex)
anIndex À§Ä¡ÀÇ Ç׸ñÀ» »èÁ¦ÇÕ´Ï´Ù. |
void |
removeItemListener (ItemListener aListener)
ItemListener ¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removePopupMenuListener (PopupMenuListener l)
PopupMenuListener ¸¦ »èÁ¦ÇÕ´Ï´Ù. |
protected void |
selectedItemChanged ()
ÀÌ protected ¸Þ¼µå´Â ±¸Çö °íÀ¯ÀÇ °ÍÀÔ´Ï´Ù. |
boolean |
selectWithKeyChar (char keyChar)
ÁöÁ¤µÈ Űº¸µåÀÇ ¹®ÀÚ¿¡ ´ëÀÀÇÏ´Â ¸®½ºÆ® Ç׸ñÀ» ¼±ÅÃÇØ, ±× ¹®ÀÚ¿¡ ´ëÀÀÇÏ´Â Ç׸ñÀÌ ÀÖ´Â °æ¿ì¿¡ true¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
void |
setAction (Action a)
ActionEvent ¼Ò½º¿¡ Action À»
¼³Á¤ÇÕ´Ï´Ù. |
void |
setActionCommand (String aCommand)
¾×¼Ç ¸®½º³Ê¿¡°Ô º¸³»Áö´Â À̺¥Æ®¿¡ Æ÷ÇÔµÇÁö ¾ÊÀ¸¸é ¾È µÇ´Â ¾×¼Ç Ä¿¸àµå¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setEditable (boolean aFlag)
JComboBox Çʵ尡 ÆíÁý °¡´ÉÇѰ¡ ¾î¶²°¡¸¦ ÁöÁ¤ÇÕ´Ï´Ù. |
void |
setEditor (ComboBoxEditor anEditor)
¼±ÅÃµÈ Ç׸ñÀ» JComboBox Çʵ忡¼ ÆäÀÎÆ® ¹× ÆíÁýÇϱâ À§Çؼ »ç¿ëµÇ´Â ¿¡µðÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setEnabled (boolean b)
Ç׸ñÀ» ¼±ÅÃÇÒ ¼ö ÀÖµµ·Ï combobox¸¦ À¯È¿ÇÏ°Ô ÇÕ´Ï´Ù. |
void |
setKeySelectionManager (JComboBox.KeySelectionManager aManager)
Űº¸µåÀÇ ¹®ÀÚ¸¦ ¸®½ºÆ®ÀÇ ¼±ÅÃÀ¸·Î º¯È¯ÇÏ´Â °´Ã¼¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setLightWeightPopupEnabled (boolean aFlag)
lightWeightPopupEnabled ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setMaximumRowCount (int count)
JComboBox °¡ Ç¥½ÃÇÏ´Â ÃÖ´ëÀÇ Çà¼ö¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setModel (ComboBoxModel aModel)
JComboBox °¡ Ç׸ñÀÇ ¸®½ºÆ®¸¦ ÃëµæÇϱâ À§Çؼ »ç¿ëÇÏ´Â µ¥ÀÌÅÍ ¸ðµ¨À» ¼³Á¤ÇÕ´Ï´Ù. |
void |
setPopupVisible (boolean v)
pop-upÀÇ °¡½Ã¼ºÀ» ¼³Á¤ÇÕ´Ï´Ù. |
void |
setPrototypeDisplayValue (Object prototypeDisplayValue)
UI ºÎºÐÀÇ Ç¥½Ã »çÀÌÁî °è»ê¿¡ »ç¿ëµÇ´Â Ç¥½Ã prototypeÄ¡¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setRenderer (ListCellRenderer aRenderer)
JComboBox ÇʵåÀÇ ¸®½ºÆ®·ÎºÎÅÍ ¼±ÅÃµÈ ¸®½ºÆ® Ç׸ñ°ú Ç׸ñÀ» ÆäÀÎÆ® ÇÏ´Â ·»´õ¸µÀ» ¼³Á¤ÇÕ´Ï´Ù. |
void |
setSelectedIndex (int anIndex)
À妽º anIndex ¿¡ ÀÖ´Â Ç׸ñÀ» ¼±ÅÃÇÕ´Ï´Ù. |
void |
setSelectedItem (Object anObject)
combobox Ç¥½Ã ¿µ¿ªÀÇ ¼±ÅÃµÈ Ç׸ñÀ» ÀμöÀÇ °´Ã¼·Î ¼³Á¤ÇÕ´Ï´Ù. |
void |
setUI (ComboBoxUI ui)
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ ·»´õ¸µ ÇÏ´Â L&F °´Ã¼¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
showPopup ()
combobox¿¡ pop-up À©µµ¿ì¸¦ Ç¥½Ã½Ãŵ´Ï´Ù. |
void |
updateUI ()
ÇöÀçÀÇ Look & Feel ·ÎºÎÅÍÀÇ °ª¿¡ UI ÇÁ·ÎÆÛƼ¸¦ ¸®¼Â ÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
ÇʵåÀÇ »ó¼¼ |
---|
protected ComboBoxModel dataModel
getModel()
,
setModel(javax.swing.ComboBoxModel)
protected ListCellRenderer renderer
getRenderer()
,
setRenderer(javax.swing.ListCellRenderer)
protected ComboBoxEditor editor
getEditor()
,
setEditor(javax.swing.ComboBoxEditor)
protected int maximumRowCount
getMaximumRowCount()
,
setMaximumRowCount(int)
protected boolean isEditable
isEditable
,
setEditable(boolean)
protected JComboBox.KeySelectionManager keySelectionManager
setKeySelectionManager(javax.swing.JComboBox.KeySelectionManager)
,
getKeySelectionManager()
protected String actionCommand
setActionCommand(java.lang.String)
,
getActionCommand()
protected boolean lightWeightPopupEnabled
setLightWeightPopupEnabled(boolean)
,
isLightWeightPopupEnabled()
protected Object selectedItemReminder
»ý¼ºÀÚ »ó¼¼ |
---|
public JComboBox(ComboBoxModel aModel)
ComboBoxModel
·Î
ºÎÅÍ ¾ò´Â JComboBox
¸¦ »ý¼ºÇÕ´Ï´Ù. ComboBoxModel
°¡ Á¦°øµÇ±â ¶§¹®¿¡
ÀÌ »ý¼ºÀÚ¸¦ »ç¿ëÇØ »ý¼ºµÈ combobox´Â µðÆúÆ®ÀÇ combobox ¸ðµ¨À» »ý¼ºÇÏÁö ¾Ê°í, »ðÀÔ, »èÁ¦ ¹× Ãß°¡ÀÇ °¢ ¸Þ¼µåÀÇ µ¿ÀÛ ¹æ¹ýÀ¸·Î °ÇÑ ¿µÇâÀ» ÁÝ´Ï´Ù.
aModel
- Ç¥½ÃµÈ Ç׸ñÀÇ ¸®½ºÆ®¸¦ Á¦°øÇÏ´Â ComboBoxModel
DefaultComboBoxModel
public JComboBox(Object [] items)
JComboBox
¸¦ »ý¼ºÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â ¹è¿ÀÇ ÃÖÃÊÀÇ Ç׸ñ°ú °Å±â¿¡ µû¸£´Â µ¥ÀÌÅÍ ¸ðµ¨ÀÌ ¼±Åõ˴ϴÙ.
items
- combobox¿¡ »ðÀÔÇÏ´Â °´Ã¼ÀÇ ¹è¿DefaultComboBoxModel
public JComboBox(Vector <? > items)
JComboBox
¸¦ »ý¼ºÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â º¤ÅÍÀÇ ÃÖÃÊÀÇ Ç׸ñ°ú °Å±â¿¡ µû¸£´Â µ¥ÀÌÅÍ ¸ðµ¨ÀÌ ¼±Åõ˴ϴÙ.
items
- combobox¿¡ »ðÀÔÇÏ´Â º¤ÅÍÀÇ ¹è¿DefaultComboBoxModel
public JComboBox()
JComboBox
¸¦ »ý¼ºÇÕ´Ï´Ù. µðÆúÆ®ÀÇ µ¥ÀÌÅÍ ¸ðµ¨Àº °´Ã¼ÀÇ ºñ¾îÀÖ´Â ¸®½ºÆ®ÀÔ´Ï´Ù. addItem
¸¦ »ç¿ëÇØ Ç׸ñÀ» Ãß°¡ÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â µ¥ÀÌÅÍ ¸ðµ¨ÀÇ ÃÖÃÊÀÇ Ç׸ñÀÌ ¼±Åõ˴ϴÙ.
DefaultComboBoxModel
¸Þ¼µåÀÇ »ó¼¼ |
---|
protected void installAncestorListener()
public void setUI(ComboBoxUI ui)
ui
- ComboBoxUI
L&F °´Ã¼UIDefaults.getUI(javax.swing.JComponent)
public void updateUI()
JComponent
³»ÀÇ updateUI
JComponent.updateUI()
public String getUIClassID()
JComponent
³»ÀÇ getUIClassID
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
public ComboBoxUI getUI()
public void setModel(ComboBoxModel aModel)
JComboBox
°¡ Ç׸ñÀÇ ¸®½ºÆ®¸¦ ÃëµæÇϱâ À§Çؼ »ç¿ëÇÏ´Â µ¥ÀÌÅÍ ¸ðµ¨À» ¼³Á¤ÇÕ´Ï´Ù.
aModel
- Ç¥½ÃµÈ Ç׸ñÀÇ ¸®½ºÆ®¸¦ Á¦°øÇÏ´Â ComboBoxModel
public ComboBoxModel getModel()
JComboBox
¿¡ ÀÇÇØ ÇöÀç »ç¿ëµÇ°í ÀÖ´Â µ¥ÀÌÅÍ ¸ðµ¨À» ¸®ÅÏÇÕ´Ï´Ù.
ComboBoxModel
public void setLightWeightPopupEnabled(boolean aFlag)
lightWeightPopupEnabled
ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. ÀÌ ÇÁ·ÎÆÛƼ´Â JComboBox
Æ÷ÇÔó·Î¼ °æ·® Component
¸¦ »ç¿ëÇÏ´ÂÁö, ±×·¸Áö ¾ÊÀ¸¸é Panel
³ª Window
µîÀÇ Áß·® Component
¸¦ »ç¿ëÇÒÁö ¾î¶³Áö¿¡ ´ëÇÑ ÈùÆ®¸¦ Á¦°øÇÕ´Ï´Ù. ¾î´À ÂÊÀ» »ç¿ëÇұ °áÁ¤ÇÏ´Â °ÍÀº ÃÖÁ¾ÀûÀ¸·Î´Â JComboBox
ÀÔ´Ï´Ù. °æ·® À©µµ¿ì´Â Áß·® À©µµ¿ìº¸´Ù È¿À²ÀûÀÔ´Ï´Ù¸¸, GUI ¿¡¼ÀÇ °æ·® ÄÄÆÛ³ÍÆ®¿Í Áß·® ÄÄÆÛ³ÍÆ®ÀÇ È¥ÇÕÀº ³Ê¹« ÁÁÀº ÀÏÀÌ ¾Æ´Õ´Ï´Ù. ¾îÇø®ÄÉÀ̼ÇÀ¸·Î ¾çÂÊ ¸ðµÎÀÇ ÄÄÆÛ³ÍÆ®°¡ »ç¿ëµÇ°í ÀÖ´Â °æ¿ì, °æ·® pop-up¸¦ ¹«È¿ÈÇÕ´Ï´Ù. lightWeightPopupEnabled
ÇÁ·ÎÆÛƼÀÇ ±âº»°ª´Â Look & Feel ·Î ´Ù¸¥ °ªÀÌ ÁöÁ¤µÇ¾î ÀÖÁö ¾ÊÀ¸¸é true
°¡ µË´Ï´Ù. ÀϺÎÀÇ Look & Feel ¿¡¼´Â ÀÌ ÇÁ·ÎÆÛƼÀÇ °ª¿¡ °ü°è¾øÀÌ Ç×»ó Áß·® pop-up°¡ »ç¿ëµË´Ï´Ù.
¡¸The Swing Connection¡¹ÀÇ ¡¸Mixing Heavy and Light Components¡¹¸¦ ÂüÁ¶ÇϽʽÿÀ. ÀÌ ¸Þ¼µå´Â ÇÁ·ÎÆÛƼ º¯°æ À̺¥Æ®¸¦ Æ®¸®°Å ÇÕ´Ï´Ù.
aFlag
- true
ÀÎ °æ¿ì´Â °æ·® pop-up°¡ ¿ä±¸µË´Ï´Ù. public boolean isLightWeightPopupEnabled()
lightWeightPopupEnabled
ÇÁ·ÎÆÛƼÀÇ °ªÀ» ¸®ÅÏÇÕ´Ï´Ù.
lightWeightPopupEnabled
ÇÁ·ÎÆÛƼÀÇ °ªsetLightWeightPopupEnabled(boolean)
public void setEditable(boolean aFlag)
JComboBox
Çʵ尡 ÆíÁý °¡´ÉÇѰ¡ ¾î¶²°¡¸¦ ÁöÁ¤ÇÕ´Ï´Ù. ÆíÁý °¡´ÉÇÑ JComboBox
¿¡
¼´Â »ç¿ëÀÚ´Â Çʵ忡 ÀÔ·ÂÇÏ´ÂÁö, ¶Ç´Â Çʵ带 ÃʱâÈÇϱâ À§Çؼ ¸®½ºÆ®·ÎºÎÅÍ Ç׸ñÀ» ¼±ÅÃÇÒ ¼ö ÀÖ¾î ±× ÈÄ¿¡ ±× Ç׸ñÀ» ÆíÁýÇÒ ¼ö ÀÖ½À´Ï´Ù. ÆíÁýÀº Çʵ忡 ´ëÇØ¼¸¸ °¡´ÉÇϰí, ¸®½ºÆ® Ç׸ñÀº º¯°æµÇÁö ¾Ê½À´Ï´Ù. ÆíÁýÀÌ ºÒ°¡´ÉÇÑ JComboBox
´Â ¼±ÅÃµÈ Ç׸ñÀ» Çʵ忡 Ç¥½ÃÇÕ´Ï´Ù¸¸, ±× ¼±ÅÃÀº ÆíÁýÇÒ ¼ö ¾ø½À´Ï´Ù.
aFlag
- boolean Ä¡. true´Â Çʵ尡 ÆíÁý °¡´ÉÇÑ °ÍÀ» ³ªÅ¸³½´Ùpublic boolean isEditable()
JComboBox
°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì´Â true¸¦ ¸®ÅÏÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â combobox´Â ÆíÁý ºÒ°¡ÀÔ´Ï´Ù.
JComboBox
°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â falsepublic void setMaximumRowCount(int count)
JComboBox
°¡ Ç¥½ÃÇÏ´Â ÃÖ´ëÀÇ Çà¼ö¸¦ ¼³Á¤ÇÕ´Ï´Ù. ¸ðµ¨³»ÀÇ °´Ã¼¼ö°¡ count º¸´Ù Å« °æ¿ì´Â combobox´Â ½ºÅ©·Ñ ¹Ù¸¦ »ç¿ëÇÕ´Ï´Ù.
count
- ½ºÅ©·Ñ ¹Ù¸¦ »ç¿ëÇÏÁö ¾Ê°í ¸®½ºÆ®¿¡ Ç¥½ÃÇÒ ¼ö ÀÖ´Â ÃÖ´ëÀÇ Ç׸ñ¼ö¸¦ ÁöÁ¤ÇÏ´Â Á¤¼ö°ª
public int getMaximumRowCount()
public void setRenderer(ListCellRenderer aRenderer)
µðÆúÆ®ÀÇ ·»´õ¸µ¿¡¼´Â ij¸¯ÅÍ ¶óÀÎ ¶Ç´ÂÀڽľÆÀÌÄÜÀÌ Ç¥½ÃµË´Ï´Ù. ´Ù¸¥ ·»´õ¸µ¿¡¼´Â ±×·¡ÇÈ À̹ÌÁö¿Í º¹ÇÕÀÚ½Ä ÅÛÀ» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
¼±ÅÃµÈ Ç׸ñÀ» Ç¥½ÃÇÏ·Á¸é,
¸®½ºÆ® °´Ã¼ ¹× À妽º -1¸¦ °Ç³×ÁÖ¾î aRenderer.getListCellRendererComponent
¸¦ È£ÃâÇÕ´Ï´Ù.
aRenderer
- ¼±ÅÃµÈ Ç׸ñÀ» Ç¥½ÃÇÏ´Â ListCellRenderer
setEditor(javax.swing.ComboBoxEditor)
public ListCellRenderer getRenderer()
JComboBox
Çʵ忡¼ Ç¥½ÃÇϱâ À§Çؼ »ç¿ëµÇ´Â ·»´õ¸µÀ» ¸®ÅÏÇÕ´Ï´Ù.
ListCellRenderer
public void setEditor(ComboBoxEditor anEditor)
JComboBox
Çʵ忡¼ ÆäÀÎÆ® ¹× ÆíÁýÇϱâ À§Çؼ »ç¿ëµÇ´Â ¿¡µðÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. ¿¡µðÅÍ´Â ¹Þ´Â JComboBox
°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì¸¸ »ç¿ëµË´Ï´Ù. ÆíÁýÇÒ ¼ö ¾ø´Â °æ¿ì´Â combobox´Â ·»´õ¸µÀ» »ç¿ëÇØ ¼±ÅÃµÈ Ç׸ñÀ» ·»´õ¸µ ÇÕ´Ï´Ù.
anEditor
- ¼±ÅÃµÈ Ç׸ñÀ» Ç¥½ÃÇÏ´Â ComboBoxEditor
setRenderer(javax.swing.ListCellRenderer)
public ComboBoxEditor getEditor()
JComboBox
Çʵ忡¼ ·»´õ¸µ ¹× ÆíÁýÇϱâ À§Çؼ »ç¿ëÇÏ´Â ¿¡µðÅ͸¦ ¸®ÅÏÇÕ´Ï´Ù.
ComboBoxEditor
public void setSelectedItem(Object anObject)
anObject
ÀÌ ¸®½ºÆ®¿¡ ÀÖ´Â °æ¿ì, Ç¥½Ã ¿µ¿ª¿¡´Â ¼±ÅÃµÈ anObject
¸¦ Ç¥½ÃÇÕ´Ï´Ù.
anObject
ÀÌ ¸®½ºÆ®¿¡ ¾ø°í, combobox°¡ ÆíÁý ºÒ°¡ÀÇ °æ¿ì, ÇöÀçÀÇ ¼±ÅÃÀº º¯°æµÇÁö ¾Ê½À´Ï´Ù. combobox°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì, ¼±ÅÃÀº anObject
·Î
º¯°æµË´Ï´Ù.
À̰Ϳ¡ ÀÇÇØ ¼±Åà Ç׸ñÀÌ º¯°æµÇ´Â °æ¿ì´Â combobox¿¡ Ãß°¡µÇ´Â ItemListener
¿¡
1°³
¶Ç´Â 2°³ÀÇ ItemEvent
ÀÌ ÅëÁöµË´Ï´Ù. ÇöÀç ¼±Åõǰí ÀÖ´Â Ç׸ñÀÌ ÀÖ´Â °æ¿ì, ItemEvent
ÀÌ Æ®¸®°Å µÇ¾î »óŰ¡ ItemEvent.DESELECTED
·Î
º¯°æµË´Ï´Ù. anObject
ÀÌ ¸®½ºÆ®¿¡ ÀÖ¾î, ÇöÀç ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì´Â ItemEvent
ÀÌ Æ®¸®°Å µÇ¾î »óÅ´ ItemEvent.SELECTED
·Î
º¯°æµË´Ï´Ù.
combobox¿¡ Ãß°¡µÈ ActionListener
´Â
ÀÌ ¸Þ¼µå°¡ ºÒ·Á °¥ ¶§¿¡ ActionEvent
·Î
ÅëÁöµË´Ï´Ù.
anObject
- ¼±ÅÃÇÏ´Â ¸®½ºÆ® °´Ã¼. ¼±ÅÃÀ» Ŭ¸®¾î ÇÏ´Â °æ¿ì´Â null
À»
ÁöÁ¤public Object getSelectedItem()
combobox°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì, ÀÌ °ªÀº addItem
, insertItemAt
, ¶Ç´Â µ¥ÀÌÅÍ »ý¼ºÀÚ¿¡¼´Â combobox¿¡ Ãß°¡µÇÁö ¾Ê½À´Ï´Ù.
setSelectedItem(java.lang.Object)
public void setSelectedIndex(int anIndex)
anIndex
¿¡ ÀÖ´Â Ç׸ñÀ» ¼±ÅÃÇÕ´Ï´Ù.
anIndex
- ¼±ÅÃÇÏ´Â ¸®½ºÆ® Ç׸ñÀ» ÁöÁ¤ÇÏ´Â Á¤¼ö°ª
. 0 Àº ¸®½ºÆ®³»ÀÇ ÃÖÃÊÀÇ Ç׸ñÀ» ÁöÁ¤. -1 ´Â ¼±ÅÃÇÏÁö ¾Ê´Â °ÍÀ» ³ªÅ¸³½´Ù
IllegalArgumentException
- anIndex
°¡ -1 º¸´Ù ÀÛÀº °æ¿ì, ȤÀº anIndex
°¡ »çÀÌÁî¿¡ µ¿ÀÏÇѰ¡ ±×°Íº¸´Ù Å« °æ¿ìpublic int getSelectedIndex()
JComboBox
°¡ ¸®½ºÆ®¿¡ ¾ø´Â Ç׸ñÀÇ ¼±ÅÃÀ» Çã°¡ÇÏ´Â °æ¿ì, ±× °á°ú°¡ Ç×»ó Á¤Àǵȴٰí´Â ÇÒ ¼ö ¾ø½À´Ï´Ù. Ç׸ñÀÌ ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì, ¶Ç´Â »ç¿ëÀÚ°¡ ¸®½ºÆ®¿¡ ¾ø´Â Ç׸ñÀ» ÁöÁ¤ÇßÀ» °æ¿ì´Â -1 ÀÌ ¸®Åϵ˴ϴÙ
.
public Object getPrototypeDisplayValue()
prototypeDisplayValue
ÇÁ·ÎÆÛƼÀÇ °ªsetPrototypeDisplayValue(java.lang.Object)
public void setPrototypeDisplayValue(Object prototypeDisplayValue)
Ç¥½Ã prototype°ªÀÌ ÁöÁ¤µÇ¸é, ±× °ªÀ» »ç¿ëÇØ ·»´õ¸µÀÌ ¼³Á¤µÇ¾î comboboxÀÇ ÀûÀýÇÑ »çÀÌÁî°¡ °è»êµË´Ï´Ù. combobox¿¡ ´ë·®ÀÇ µ¥ÀÌÅͰ¡ Ç¥½ÃµÇ´Â °æ¿ì´Â ÀûÀýÇÑ Ç¥½Ã »çÀÌÁîÄ¡ÀÇ ÁöÁ¤ÀÌ À¯È¿ÇÏ°Ô µË´Ï´Ù. Ç¥½Ã prototype°ªÀÌ ÁöÁ¤µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì, ·»´õ¸µÀ¸·Î ¸ðµ¨ ¸¶´Ù °ªÀ» ÁöÁ¤ÇØ ÀûÀý »çÀÌÁ °è»êÇÏÁö ¾ÊÀ¸¸é ¾ÈµÇ¾î, »ó´ëÀûÀ¸·Î ó¸® ½ºÅÜÀÌ ¸¹¾ÆÁý´Ï´Ù.
prototypeDisplayValue
- @see #getPrototypeDisplayValuepublic void addItem(Object anObject)
JComboBox
°¡ °¡º¯ µ¥ÀÌÅÍ ¸ðµ¨À» »ç¿ëÇÏ´Â °æ¿ì¿¡¸¸ À¯È¿ÇÕ´Ï´Ù.
°æ°í: String °´Ã¼¸¦ Áߺ¹ÀÇÇØ Ãß°¡Çϸé, Æ÷Ä¿½º ¹× Űº¸µå ³×ºñ°ÔÀ̼ÇÀÇ ¹®Á¦°¡ ¹ß»ýÇÒ °¡´É¼ºÀÌ ÀÖ½À´Ï´Ù. ȸÇÇÃ¥À¸·Î¼ String °´Ã¼ ´ë½Å¿¡ »õ·Î¿î °´Ã¼¸¦ Ãß°¡ÇØ, toString() ¸Þ¼µå¸¦ È®½ÇÈ÷ Á¤ÀÇÇÕ´Ï´Ù. ´ÙÀ½¿¡ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù.
comboBox.addItem(makeObj("Item 1")); comboBox.addItem(makeObj("Item 1")); ... private Object makeObj(final String item) { return new Object() { public String toString() { return item; } }; }
anObject
- ¸®½ºÆ®¿¡ Ãß°¡ÇÏ´Â ObjectMutableComboBoxModel
public void insertItemAt(Object anObject, int index)
JComboBox
°¡ °¡º¯ µ¥ÀÌÅÍ ¸ðµ¨À» »ç¿ëÇÏ´Â °æ¿ì¿¡¸¸ À¯È¿ÇÕ´Ï´Ù.
anObject
- ¸®½ºÆ®¿¡ Ãß°¡ÇÏ´Â Object
index
- Ç׸ñÀ» Ãß°¡ÇÏ´Â À§Ä¡¸¦ ÁöÁ¤ÇÏ´Â Á¤¼ö°ª
MutableComboBoxModel
public void removeItem(Object anObject)
JComboBox
°¡ °¡º¯ µ¥ÀÌÅÍ ¸ðµ¨À» »ç¿ëÇÏ´Â °æ¿ì¿¡¸¸ À¯È¿ÇÕ´Ï´Ù.
anObject
- Ç׸ñ ¸®½ºÆ®·ÎºÎÅÍ »èÁ¦ÇÏ´Â °´Ã¼MutableComboBoxModel
public void removeItemAt(int anIndex)
anIndex
À§Ä¡ÀÇ Ç׸ñÀ» »èÁ¦ÇÕ´Ï´Ù. ÀÌ ¸Þ¼µå´Â JComboBox
°¡ °¡º¯ µ¥ÀÌÅÍ ¸ðµ¨À» »ç¿ëÇÏ´Â °æ¿ì¿¡¸¸ À¯È¿ÇÕ´Ï´Ù.
anIndex
- »èÁ¦ÇÏ´Â Ç׸ñÀÇ À妽º¸¦ ÁöÁ¤ÇÏ´Â Á¤¼ö°ª
. 0 Àº ¸®½ºÆ®³»ÀÇ ÃÖÃÊÀÇ Ç׸ñÀ» ³ªÅ¸³»´ÂMutableComboBoxModel
public void removeAllItems()
public void showPopup()
setPopupVisible(boolean)
public void hidePopup()
setPopupVisible(boolean)
public void setPopupVisible(boolean v)
public boolean isPopupVisible()
public void addItemListener(ItemListener aListener)
ItemListener
¸¦ Ãß°¡ÇÕ´Ï´Ù.
aListener
´Â ¼±ÅÃÇÑ Ç׸ñÀÌ º¯°æµÇ¸é 1°³
¶Ç´Â 2°³ÀÇ ItemEvent
¸¦ ¼ö½ÅÇÕ´Ï´Ù.
ItemSelectable
³»ÀÇ addItemListener
aListener
- ÅëÁöµÇ´Â ItemListener
setSelectedItem(java.lang.Object)
public void removeItemListener(ItemListener aListener)
ItemListener
¸¦ »èÁ¦ÇÕ´Ï´Ù.
ItemSelectable
³»ÀÇ removeItemListener
aListener
- »èÁ¦µÇ´Â ItemListener
ItemEvent
public ItemListener [] getItemListeners()
ItemListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
ItemListener
. ¸®½º³Ê°¡ Ãß°¡µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿public void addActionListener(ActionListener l)
ActionListener
¸¦ Ãß°¡ÇÕ´Ï´Ù.
ActionListener
´Â ¼±ÅÃÀ» ÇßÀ» ¶§¿¡ ActionEvent
¸¦ ¼ö½ÅÇÕ´Ï´Ù. combobox°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì´Â ÆíÁýÀÌ Á¤ÁöµÇ¸é ActionEvent
ÀÌ Æ®¸®°Å µË´Ï´Ù.
l
- ÅëÁöµÇ´Â ActionListener
setSelectedItem(java.lang.Object)
public void removeActionListener(ActionListener l)
ActionListener
¸¦ »èÁ¦ÇÕ´Ï´Ù.
l
- »èÁ¦µÇ´Â ActionListener
public ActionListener [] getActionListeners()
ActionListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
ActionListener
. ¸®½º³Ê°¡ Ãß°¡µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿public void addPopupMenuListener(PopupMenuListener l)
PopupMenu
¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù.
Java 2
¸ðµç Ç¥ÁØ Look & Feel ¿¡¼´Â comboboxÀÇ pop-up ¸®½ºÆ® ºÎºÐÀº JPopupMenu
·Î
¼ ±¸ÇöµË´Ï´Ù. Ä¿½ºÅÒ Look & Feel ¿¡¼´Â ±¸Çö ÇüŰ¡ ´Þ¶ó, ÅëÁö¸¦ ¼ö½ÅÇÏÁö ¾Ê½À´Ï´Ù.
l
- Ãß°¡ÇÏ´Â PopupMenuListener
public void removePopupMenuListener(PopupMenuListener l)
PopupMenuListener
¸¦ »èÁ¦ÇÕ´Ï´Ù.
l
- »èÁ¦ÇÏ´Â PopupMenuListener
addPopupMenuListener(javax.swing.event.PopupMenuListener)
public PopupMenuListener [] getPopupMenuListeners()
PopupMenuListener
¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
PopupMenuListener
. Ãß°¡µÈ ¸®½º³Ê°¡ ¾ø´Â °æ¿ì´Â ºñ¾îÀÖ´Â ¹è¿public void firePopupMenuWillBecomeVisible()
PopupMenuListener
¿¡ ÅëÁöÇÕ´Ï´Ù.
ÀÌ ¸Þ¼µå´Â public ÀÔ´Ï´Ù¸¸ UI À§¾ç Àܷ̿κÎÅʹ ȣÃâÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä.
addPopupMenuListener(javax.swing.event.PopupMenuListener)
public void firePopupMenuWillBecomeInvisible()
PopupMenuListener
¿¡ ÅëÁöÇÕ´Ï´Ù.
ÀÌ ¸Þ¼µå´Â public ÀÔ´Ï´Ù¸¸ UI À§¾ç Àܷ̿κÎÅʹ ȣÃâÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä.
addPopupMenuListener(javax.swing.event.PopupMenuListener)
public void firePopupMenuCanceled()
PopupMenuListener
¿¡ ÅëÁöÇÕ´Ï´Ù.
ÀÌ ¸Þ¼µå´Â public ÀÔ´Ï´Ù¸¸ UI À§¾ç Àܷ̿κÎÅʹ ȣÃâÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä.
addPopupMenuListener(javax.swing.event.PopupMenuListener)
public void setActionCommand(String aCommand)
aCommand
- ¾×¼Ç ¸®½º³Ê¿¡°Ô º¸³»Áö´Â ¡¸Ä¿¸àµå¡¹¸¦ Æ÷ÇÔÇÑ Ä³¸¯ÅÍ ¶óÀÎ. ¸®½º³Ê´Â ¼ö½ÅÇÏ´Â Ä¿¸àµå¿¡ ÀÀÇØ ´Ù¸¥ 󸮸¦ ½ÇÇàÇÒ ¼ö ÀÖ´Ùpublic String getActionCommand()
public void setAction(Action a)
ActionEvent
¼Ò½º¿¡ Action
À»
¼³Á¤ÇÕ´Ï´Ù. »õ·Î¿î Action
´Â ¼³Á¤ ³¡³ Action
¿Í
¿Å°ÜÁý´Ï´Ù¸¸, addActionListener
·Î
µ¶¸³ÇØ Ãß°¡µÈ ActionListener
¿¡´Â ¿µÇâÀ» ÁÖÁö ¾Ê½À´Ï´Ù. Action
°¡ À̹Ì
ActionEvent
¼Ò½º¿¡ À̹Ì
µî·ÏµÇ¾î ÀÖ´Â ActionListener
ÀÎ °æ¿ì´Â Àçµî·ÏµÇÁö ¾Ê½À´Ï´Ù.
Action
À»
¼³Á¤Çϸé, ActionEvent
¼Ò½ºÀÇ ÇÁ·ÎÆÛƼ°¡Action
°ªÀ¸·ÎºÎÅÍ Áï½Ã ¼³Á¤µÇ°í (configurePropertiesFromAction
¸Þ¼µå·Î ½ÇÇà), °è¼ÓµÇ¾î createActionPropertyChangeListener
¸Þ¼µå°¡ ÀÛ¼ºÇÑ PropertyChangeListener
¿¡
ÀÇÇØ Action
ÇÁ·ÎÆÛƼÀÇ º¯°æ¿¡ µû¶ó °»½ÅµË´Ï´Ù.
a
- JComboBox
Action
, ¶Ç´Â null
Action
,
getAction()
,
configurePropertiesFromAction(javax.swing.Action)
,
createActionPropertyChangeListener(javax.swing.Action)
public Action getAction()
ActionEvent
¼Ò½º¿¡ ÇöÀç ¼³Á¤µÇ¾î ÀÖ´Â Action
À»
¸®ÅÏÇÕ´Ï´Ù. Action
°¡ ¼³Á¤µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì´Â null
ÀÌ ¸®Åϵ˴ϴÙ
.
ActionEvent
¼Ò½ºÀÇ Action
, ¶Ç´Â null
Action
,
setAction(javax.swing.Action)
protected void configurePropertiesFromAction(Action a)
Action
ÀνºÅϽºÀÇ °ª¿¡ µû¶ó ActionEvent
¼Ò½ºÀÇ ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÏ´Â ÆÑÅ丮 ¸Þ¼µåÀÔ´Ï´Ù. ¼³Á¤µÇ´Â ÇÁ·ÎÆÛƼ´Â ¼ºê Ŭ·¡½º¿¡ ÀÇÇØ ´Ù¸¨´Ï´Ù. µðÆúÆ®¿¡¼´Â ¼³Á¤µÇ´Â ÇÁ·ÎÆÛƼ´Â Enabled
¹× ToolTipText
ÀÔ´Ï´Ù.
a
- ÇÁ·ÎÆÛƼ¸¦ ¾ò´Â Action
, ¶Ç´Â null
Action
,
setAction(javax.swing.Action)
protected PropertyChangeListener createActionPropertyChangeListener(Action a)
ActionEvent
¼Ò½º¸¦ Action
ÀνºÅϽºÀÇ ÇÁ·ÎÆÛƼÀÇ º¯°æ¿¡ µû¶ó °»½ÅÇϱâ À§Çؼ »ç¿ëÇÏ´Â PropertyChangeListener
¸¦ »ý¼ºÇÏ´Â ÆÑÅ丮 ¸Þ¼µåÀÔ´Ï´Ù. ÃֽŠ»óÅ·Πº¸°ü À¯ÁöÇÒ Çʿ䰡 ÀÖ´Â ÇÁ·ÎÆÛƼ¼¼Æ®°¡ µðÆúÆ® ÇÁ·ÎÆÛƼ (Text, Icon, Enabled, ToolTipText)¿Í ´Ù¸¥ °æ¿ì´Â µ¶ÀÚÀûÀÎ PropertyChangeListener
¸¦ Á¦°øÇϱâ À§Çؼ ¼ºê Ŭ·¡½º°¡ ÀÌ ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÏ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
PropertyChangeListener
´Â ActionEvent
¼Ò½º¿¡ÀÇ °ÂüÁ¶¸¦ º¸°ü À¯ÁöÇÏÁö ¾Ê°Ô ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. À̰ÍÀº, ActionEvent
¼Ò½ºÀÇ °¡ºñÁö Ä÷º¼Ç ¹× ¸ðµç Æ÷ÇÔ °ü°èÀÇ °èÃþÀÇ ÄÄÆÛ³ÍÆ®¸¦ ¹æÇØÇÒ °¡´É¼ºÀÌ Àֱ⠶§¹®ÀÔ´Ï´Ù.
Action
,
setAction(javax.swing.Action)
protected void fireItemStateChanged(ItemEvent e)
e
- ´ë»óÀÇ À̺¥Æ®EventListenerList
protected void fireActionEvent()
EventListenerList
protected void selectedItemChanged()
public Object [] getSelectedObjects()
ItemSelectable
¿Í
ÀÇ È£È¯¼ºÀ» À§Çؼ ±¸ÇöµË´Ï´Ù.
ItemSelectable
³»ÀÇ getSelectedObjects
Object
¹è¿public void actionPerformed(ActionEvent e)
ActionListener
³»ÀÇ actionPerformed
public void contentsChanged(ListDataEvent e)
ListDataListener
³»ÀÇ contentsChanged
e
- À̺¥Æ® Á¤º¸¸¦ ĸ½¶ÈÇÏ´Â ListDataEvent
public void intervalAdded(ListDataEvent e)
ListDataListener
³»ÀÇ intervalAdded
e
- À̺¥Æ® Á¤º¸¸¦ ĸ½¶ÈÇÏ´Â ListDataEvent
public void intervalRemoved(ListDataEvent e)
ListDataListener
³»ÀÇ intervalRemoved
e
- À̺¥Æ® Á¤º¸¸¦ ĸ½¶ÈÇÏ´Â ListDataEvent
public boolean selectWithKeyChar(char keyChar)
keyChar
- ¹®ÀÚ. ÀϹÝÀûÀ¸·Î »ç¿ëÀÚ°¡ ´©¸¥ Űº¸µåÀÇ Å°public void setEnabled(boolean b)
JComponent
³»ÀÇ setEnabled
b
- boolean Ä¡. trueÀÎ °æ¿ì´Â ÄÄÆÛ³ÍÆ®´Â »ç¿ë °¡´ÉÇØ, falseÀÎ °æ¿ì´Â »ç¿ë ºÒ°¡Component.isEnabled()
,
Component.isLightweight()
public void configureEditor(ComboBoxEditor anEditor, Object anItem)
anEditor
- comboboxÀÇ Çʵ忡 ¸®½ºÆ® Ç׸ñÀ» Ç¥½ÃÇØ, ±× ÆíÁýÀ» °¡´ÉÇÏ°Ô ÇÏ´Â ComboBoxEditor
anItem
- Çʵ忡¼ Ç¥½Ã ¹× ÆíÁýÀ» ½Ç½ÃÇÏ´Â °´Ã¼public void processKeyEvent(KeyEvent e)
KeyEvent
¸¦ ó¸®ÇÕ´Ï´Ù. Tab ۰¡ ¹ß°ßµÇ¸é, pop-up À©µµ¿ì°¡ ´Ý½À´Ï´Ù.
JComponent
³»ÀÇ processKeyEvent
e
- ´·ÁÁøÅ°º¸µåÀÇ Å°¸¦ Æ÷ÇÔÇÑ KeyEvent
KeyEvent
,
KeyListener
,
KeyboardFocusManager
,
DefaultKeyboardFocusManager
,
Component.processEvent(java.awt.AWTEvent)
,
Component.dispatchEvent(java.awt.AWTEvent)
,
Component.addKeyListener(java.awt.event.KeyListener)
,
Component.enableEvents(long)
,
Component.isShowing()
public void setKeySelectionManager(JComboBox.KeySelectionManager aManager)
public JComboBox.KeySelectionManager getKeySelectionManager()
KeySelectionManager
public int getItemCount()
public Object getItemAt(int index)
index
°¡ ¹üÀ§¿ÜÀÇ °æ¿ì, Áï Á¦·Îº¸´Ù ÀÛÀºÁö, »çÀÌÁî ÀÌ»óÀÇ °æ¿ì´Â null
À»
¸®ÅÏÇÕ´Ï´Ù.
index
- ¸®½ºÆ® À§Ä¡¸¦ ³ªÅ¸³»´Â Á¤¼ö°ª
. ÃÖÃÊÀÇ Ç׸ñÀº Á¦·Î·Î ½ÃÀ۵ȴÙ
Object
. ¹üÀ§¿ÜÀÇ °æ¿ì´Â null
protected JComboBox.KeySelectionManager createDefaultKeySelectionManager()
KeySelectionManager
setKeySelectionManager(javax.swing.JComboBox.KeySelectionManager)
protected String paramString()
JComboBox
ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. ÀÌ ¸Þ¼µå´Â µð¹ö±× Àü¿ëÀ̸ç, ¸®ÅϵÈ
ij¸¯ÅÍ ¶óÀÎÀÇ ³»¿ë ¹× Çü½ÄÀº ±¸Çö¿¡ µû¶ó¼ ´Ù¸¨´Ï´Ù. ¸®ÅϵÈ
ij¸¯ÅÍ ¶óÀÎÀº ºñ¾îÀÖ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù¸¸, null
·Î´Â µÇÁö ¾Ê½À´Ï´Ù.
JComponent
³»ÀÇ paramString
JComboBox
ij¸¯ÅÍ ¶óÀΠǥÇöpublic AccessibleContext getAccessibleContext()
Accessible
³»ÀÇ getAccessibleContext
JComponent
³»ÀÇ getAccessibleContext
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.