|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JComboBox
¹öư, ¶Ç´Â ÆíÁý °¡´É Çʵå¿Í µå·Ó ´Ù¿î ¸®½ºÆ®¸¦ Á¶ÇÕÇÑ ÄÄÆÛ³ÍÆ®ÀÔ´Ï´Ù. À¯Àú´Â ¿ä±¸¿¡ ÀÀÇØ Ç¥½ÃµÇ´Â µå·Ó ´Ù¿î ¸®½ºÆ®·ÎºÎÅÍ °ªÀ» ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. combobox¸¦ ÆíÁý °¡´ÉÇÏ°Ô Çϸé(ÀÚ), ÆíÁý °¡´ÉÇÑ Çʵ带 °¡Áö°Ô µÇ¾î, À¯Àú°¡ °ªÀ» ÀÚÀ¯·Ó°Ô ÀÔ·ÂÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù.
Ç¥ÁØÀÇ Look & Feel (L&F) Ç¥ÇöÀ¸·Î ÀÌ ÄÄÆÛ³ÍÆ®°¡ »ç¿ëÇϴ Űº¸µåÀÇ Å°¿¡ ´ëÇØ¼´Â ¡¸JComboBox
ÀÇ Å°ÀÇ ÇҴ硹À» ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
°æ°í:
ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ ¿ÀºêÁ§Æ®´Â ÇâÈÄ ¸±¸®½º µÇ´Â Swing ¿ÍÀÇ È£È¯¼ºÀº ¾ø½À´Ï´Ù. ÇöÀç ¼Æ÷Æ®µÇ°í ÀÖ´Â Á÷·ÄÈ´Â ´Ü±â°£ÀÇ º¸°ü, ¶Ç´Â °°Àº ¹öÁ¯ÀÇ Swing °¡ °¡µ¿Çϰí ÀÖ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI ¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. 1.4 ·ÎºÎÅÍ´Â ¸ðµç JavaBeansTM ÀÇ Àå±â°£ÀÇ º¸°üÀÌ java.beans
ÆÐŰÁö·Î Ãß°¡ ¼Æ÷Æ®µÇ°í ÀÖ½À´Ï´Ù. XMLEncoder
¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
ÀÚ¼¼ÇÑ °ÍÀº ¡¸The Java Tutorial¡¹ ÀÇ¡¸How to Use Combo Boxes¡¹¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
ComboBoxModel
,
DefaultComboBoxModel
ÁßøµÈ Ŭ·¡½ºÀÇ °³¿ä | |
protected class |
JComboBox.AccessibleJComboBox
ÀÌ Å¬·¡½º´Â JComboBox Ŭ·¡½º¿ëÀÇ À¯Àú º¸Á¶ ±â´ÉÀÇ ¼Æ÷Æ®¸¦ ±¸ÇöÇϰí ÀÖ½À´Ï´Ù. |
static interface |
JComboBox.KeySelectionManager
KeySelectionManager ¸¦ Á¤ÀÇÇÏ´Â ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. |
Ŭ·¡½º javax.swing. JComponent À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
|
Ŭ·¡½º java.awt. Container À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
|
Ŭ·¡½º java.awt. Component À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
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)
ÇÁ·ÎÆÛƼ°¡ Action ÀνºÅϽº¸¦ º¯°æÇßÀ» ¶§¿¡ ActionEvent ¼Ò½ºÀÇ °»½Å¿¡ »ç¿ëÇÏ´Â 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 ÀÇ Ä³¸¯ÅÍ ¶óÀΠǥÇöÀ» µ¹·ÁÁÝ´Ï´Ù. |
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)
ÁöÁ¤µÈ Űº¸µåÀÇ Ä³¸¯ÅÍ¿¡ ´ëÀÀÇÏ´Â ¸®½ºÆ® Ç׸ñÀ» ¼±ÅÃÇØ, ±× ij¸¯ÅÍ¿¡ ´ëÀÀÇÏ´Â Ç׸ñÀÌ ÀÖ´Â °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
void |
setAction (Action a)
ActionEvent ¼Ò½º¿¡ Action ¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setActionCommand (String aCommand)
¾×¼Ç ûÃëÀÚ¿¡°Ô º¸³»Áö´Â À̺¥Æ®¿¡ Æ÷ÇÔµÇÁö ¾ÊÀ¸¸é ¾È µÇ´Â ¾×¼Ç Ä¿¸àµå¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setEditable (boolean aFlag)
JComboBox Çʵ尡 ÆíÁý °¡´ÉÇѰ¡ ¾î¶²°¡¸¦ ÁöÁ¤ÇÕ´Ï´Ù. |
void |
setEditor (ComboBoxEditor anEditor)
¼±ÅÃµÈ Ç׸ñÀ» JComboBox Çʵ忡¼ paint ¹× ÆíÁýÇϱâ À§Çؼ »ç¿ëµÇ´Â ¿¡µðÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. |
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 ÇʵåÀÇ ¸®½ºÆ®·ÎºÎÅÍ ¼±ÅÃµÈ ¸®½ºÆ® Ç׸ñ°ú Ç׸ñÀ» paint ÇÏ´Â ·»´õ¸µÀ» ¼³Á¤ÇÕ´Ï´Ù. |
void |
setSelectedIndex (int anIndex)
À妽º anIndex ¿¡ ÀÖ´Â Ç׸ñÀ» ¼±ÅÃÇÕ´Ï´Ù. |
void |
setSelectedItem (Object anObject)
combobox Ç¥½Ã areaÀÇ ¼±ÅÃµÈ Ç׸ñÀ» ÀμöÀÇ ¿ÀºêÁ§Æ®·Î ¼³Á¤ÇÕ´Ï´Ù. |
void |
setUI (ComboBoxUI ui)
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ Ç¥Çö ÇÏ´Â L&F ¿ÀºêÁ§Æ®¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
showPopup ()
combobox¿¡ pop-up À©µµ¿ì¸¦ Ç¥½Ã½Ãŵ´Ï´Ù. |
void |
updateUI ()
ÇöÀçÀÇ Look & Feel ·ÎºÎÅÍÀÇ °ªÀ¸·Î UI ÇÁ·ÎÆÛƼ¸¦ ¸®¼ÂÆ® ÇÕ´Ï´Ù. |
Ŭ·¡½º java.awt. Container ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
add , add , add , add , add , addContainerListener , addImpl , applyComponentOrientation , areFocusTraversalKeysSet , countComponents , deliverEvent , doLayout , findComponentAt , findComponentAt , getComponent , getComponentAt , getComponentAt , getComponentCount , getComponents , getContainerListeners , getFocusTraversalKeys , getFocusTraversalPolicy , getLayout , insets , invalidate , isAncestorOf , isFocusCycleRoot , isFocusCycleRoot , isFocusTraversalPolicySet , layout , list , list , locate , minimumSize , paintComponents , preferredSize , printComponents , processContainerEvent , processEvent , remove , remove , removeAll , removeContainerListener , setFocusCycleRoot , setFocusTraversalKeys , setFocusTraversalPolicy , setLayout , transferFocusBackward , transferFocusDownCycle , validate , validateTree |
Ŭ·¡½º 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
°¡ Á¦°øµÇ±â (À§ÇØ)¶§¹®¿¡, ÀÌ constructor¸¦ »ç¿ëÇØ »ý¼ºµÈ 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
Çʵ忡¼ paint ¹× ÆíÁýÇϱâ À§Çؼ »ç¿ëµÇ´Â ¿¡µðÅ͸¦ ¼³Á¤ÇÕ´Ï´Ù. ¿¡µðÅÍ´Â ¹Þ´Â JComboBox
°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì¸¸ »ç¿ëµË´Ï´Ù. ÆíÁýÇÒ ¼ö ¾ø´Â °æ¿ì´Â combobox´Â ·»´õ¸µÀ» »ç¿ëÇØ ¼±ÅÃµÈ Ç׸ñÀ» Ç¥Çö ÇÕ´Ï´Ù.
anEditor
- ¼±ÅÃµÈ Ç׸ñÀ» Ç¥½ÃÇÏ´Â ComboBoxEditor
setRenderer(javax.swing.ListCellRenderer)
public ComboBoxEditor getEditor()
JComboBox
Çʵ忡¼ Ç¥Çö ¹× ÆíÁýÇϱâ À§Çؼ »ç¿ëÇÏ´Â ¿¡µðÅ͸¦ µ¹·ÁÁÝ´Ï´Ù.
ComboBoxEditor
public void setSelectedItem(Object anObject)
anObject
°¡ ¸®½ºÆ®¿¡ ÀÖ´Â °æ¿ì, Ç¥½Ã area¿¡´Â ¼±ÅÃµÈ anObject
¸¦ Ç¥½ÃÇÕ´Ï´Ù.
anObject
°¡ ¸®½ºÆ®¿¡ ¾ø°í , combobox°¡ ÆíÁý ºÒ°¡ÀÇ °æ¿ì, ÇöÀçÀÇ ¼±ÅÃÀº º¯°æµÇÁö ¾Ê½À´Ï´Ù. combobox°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì, ¼±ÅÃÀº anObject
·Î º¯°æµË´Ï´Ù.
À̰Ϳ¡ ÀÇÇØ ¼±Åà Ç׸ñÀÌ º¯°æµÇ´Â °æ¿ì´Â combobox¿¡ Ãß°¡µÇ´Â ItemListener
¿¡, 1 kr ¶Ç´Â 2 °³ÀÇ ItemEvent
°¡ ÅëÁöµË´Ï´Ù. ÇöÀç ¼±Åõǰí ÀÖ´Â Ç׸ñÀÌ ÀÖ´Â °æ¿ì,ItemEvent
°¡ ¹æ¾Æ¼è µÇ¾î »óŰ¡ ItemEvent.DESELECTED
·Î º¯°æµË´Ï´Ù. anObject
°¡ ¸®½ºÆ®¿¡ ÀÖ¾î, ÇöÀç ¼±ÅõǾî ÀÖÁö ¾ÊÀº °æ¿ì´Â ItemEvent
°¡ ¹æ¾Æ¼è µÇ¾î »óÅ´ ItemEvent.SELECTED
·Î º¯°æµË´Ï´Ù.
combobox¿¡ Ãß°¡µÈ ActionListener
´Â ÀÌ ¸Þ¼Òµå°¡ ºÒ·Á °¥ ¶§¿¡ ActionEvent
·Î ÅëÁöµË´Ï´Ù.
anObject
- ¼±ÅÃÇÏ´Â ¸®½ºÆ® ¿ÀºêÁ§Æ®. ¼±ÅÃÀ» Ŭ¸®¾î ÇÏ´Â °æ¿ì´Â null
¸¦ ÁöÁ¤public Object getSelectedItem()
combobox°¡ ÆíÁý °¡´ÉÇÑ °æ¿ì, ÀÌ °ªÀº addItem
,insertItemAt
, ¶Ç´Â µ¥ÀÌÅÍ constructor ¿¡¼´Â 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
- getPrototypeDisplayValue()
public 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 kr ¶Ç´Â 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 delegate Àܷ̿κÎÅʹ ȣÃâÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä.
addPopupMenuListener(javax.swing.event.PopupMenuListener)
public void firePopupMenuWillBecomeInvisible()
PopupMenuListener
¿¡ ÅëÁöÇÕ´Ï´Ù.
ÀÌ ¸Þ¼Òµå´Â public ÀÔ´Ï´Ù¸¸ UI delegate Àܷ̿κÎÅʹ ȣÃâÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä.
addPopupMenuListener(javax.swing.event.PopupMenuListener)
public void firePopupMenuCanceled()
PopupMenuListener
¿¡ ÅëÁöÇÕ´Ï´Ù.
ÀÌ ¸Þ¼Òµå´Â public ÀÔ´Ï´Ù¸¸ UI delegate Àܷ̿κÎÅʹ ȣÃâÇÏÁö ¸»¾Æ ÁÖ¼¼¿ä.
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)
Action
ÀνºÅϽº¸¦ º¯°æÇßÀ» ¶§¿¡ ActionEvent
¼Ò½ºÀÇ °»½Å¿¡ »ç¿ëÇÏ´Â PropertyChangeListener
¸¦ »ý¼ºÇÏ´Â ÆÑÅ丮 ¸Þ¼ÒµåÀÔ´Ï´Ù. ¼ºê Ŭ·¡½º°¡ ÃֽŠ»óÅ·Πº¸°ü À¯ÁöÇÒ Çʿ䰡 ÀÖ´Â ÇÁ·ÎÆÛƼ¼¼Æ®°¡ µðÆúÆ® ÇÁ·ÎÆÛƼ (Text, Icon, Enabled, ToolTipText)¿Í ´Ù¸¥ °æ¿ì´Â µ¶ÀÚÀûÀÎ PropertyChangeListener
¸¦ Á¦°øÇϱâ À§Çؼ ÀÌ ¸Þ¼Òµå¸¦ ¿À¹ö¶óÀ̵å(override) ÇÒ ¼ö ÀÖ½À´Ï´Ù. PropertyChangeListeners
°¡ 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
- ij¸¯ÅÍ. Åë»óÀº À¯Àú°¡ ´©¸¥ Űº¸µåÀÇ Å°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
,
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¸¯ÅÍ ¶óÀÎÀº ºñ¾úÀ» °æ¿ì°¡ ÀÖ½À´Ï´Ù¸¸,null
·Î´Â µÇÁö ¾Ê½À´Ï´Ù.
JComponent
³»ÀÇ paramString
JComboBox
ÀÇ Ä³¸¯ÅÍ ¶óÀΠǥÇöpublic AccessibleContext getAccessibleContext()
Accessible
³»ÀÇ getAccessibleContext
JComponent
³»ÀÇ getAccessibleContext
|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ ÀÖ¾î¼ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.