|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPopupMenu
pop-up menuÀÇ ±¸ÇöÀÔ´Ï´Ù. pop-up menu´Â ÀÛÀº À©µµ¿ì·Î, º¹¼öÀÇ ¼±ÅûçÇ× (¸Þ´º Ä¿¸àµå)À» Ç¥½ÃÇÕ´Ï´Ù. JPopupMenu
´Â µµ±¸¸ðÀ½»óÀÇ Ç׸ñÀÌ ¼±ÅõǾúÀ» ¶§¿¡ Ç¥½ÃÇÏ´Â ¸Þ´º¿¡ »ç¿ëÇÕ´Ï´Ù. ¶Ç, ¼±ÅÃÇÑ ¸Þ´º Ç׸ñ¿¡ µû¶ó¼´Â Ç¥½ÃµÇ´Â Àϵµ ÀÖ´Â ÇÁ¸£¶óÀÌÆ®¸Þ´º¿¡µµ »ç¿ëµË´Ï´Ù. ȤÀº ¸Þ´º¸¦ Ç¥½Ã½ÃŰ°í ½ÍÀº ´Ù¸¥ Àå¼Ò (µµ±¸¸ðÀ½ ÀÌ¿ÜÀÇ Àå¼Ò)¿¡¼µµ,JPopupMenu
¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î, ƯÁ¤ÀÇ Àå¼Ò¿¡¼ ¿À¸¥ÂÊ Å¬¸¯ÀÌ ¹ß»ýÇßÀ» °æ¿ìÀÇ pop-up menu Ç¥½Ã (¼îÆ® ÄÆ ¸Þ´º) µîÀÔ´Ï´Ù.
pop-up menuÀÇ »ó¼¼¿Í »ç¿ë¿¹¿¡ ´ëÇØ¼´Â ¡¸The Java Tutorial¡¹ÀÇ¡¸How to Use Menus¡¹¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä. Ç¥ÁØÀÇ Look & Feel (L&F) Ç¥ÇöÀ¸·Î ÀÌ ÄÄÆÛ³ÍÆ®°¡ »ç¿ëÇϴ Űº¸µåÀÇ Å°¿¡ ´ëÇØ¼´Â ¡¸JPopupMenu
ÀÇ Å° ÇÒ´çÇÏ°í¡¹¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
°æ°í:
ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ ¿ÀºêÁ§Æ®´Â ÇâÈÄÀÇ Swing ¸±¸®½º¿Í ȣȯÀº ¾Æ´Ï°Ô µÉ ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈÀÇ ¼Æ÷Æ®´Â ´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÁ¯ÀÇ Swing ¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI ¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. 1.4 ¿¡¼´Â ¸ðµç JavaBeansTM ÀÇ Àå±â°£ÀÇ ¿î¿ë¿¡ ´ëÇÑ ¼Æ÷Æ®°¡ java.beans
ÆÐŰÁö¿¡ Ãß°¡µÇ¾ú½À´Ï´Ù. XMLEncoder
¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
ÁßøµÈ Ŭ·¡½ºÀÇ °³¿ä | |
protected class |
JPopupMenu.AccessibleJPopupMenu
ÀÌ Å¬·¡½º´Â JPopupMenu Ŭ·¡½º¿ëÀÇ À¯Àú º¸Á¶ ±â´ÉÀÇ ¼Æ÷Æ®¸¦ ±¸ÇöÇϰí ÀÖ½À´Ï´Ù. |
static class |
JPopupMenu.Separator
pop-up menu °íÀ¯ÀÇ separatorÀÔ´Ï´Ù. |
Ŭ·¡½º javax.swing. JComponent À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
|
Ŭ·¡½º java.awt. Container À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
|
Ŭ·¡½º java.awt. Component À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
Component.BltBufferStrategy , Component.FlipBufferStrategy |
ÇʵåÀÇ °³¿ä |
Ŭ·¡½º 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 |
»ý¼ºÀÚÀÇ °³¿ä | |
JPopupMenu ()
È£Ãâ ÄÄÆÛ³ÍÆ®ÀÇ Á¤ÀǾøÀÌ JPopupMenu ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
JPopupMenu (String label)
ÁöÁ¤µÈ ŸÀÌÆ²ÀÇ PopupMenu ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
¸Þ¼ÒµåÀÇ °³¿ä | |
JMenuItem |
add (Action a)
ÁöÁ¤µÈ Action ¿ÀºêÁ§Æ®¸¦ µð½ºÆÌÄ¡ ÇÏ´Â ¸Þ´ºÀÇ ¸»¹Ì¿¡ »õ·Î¿î ¸Þ´º Ç׸ñÀ» Ãß°¡ÇÕ´Ï´Ù. |
JMenuItem |
add (JMenuItem menuItem)
ÁöÁ¤µÈ ¸Þ´º Ç׸ñÀ» ¸Þ´ºÀÇ ¸»¹Ì¿¡ Ãß°¡ÇÕ´Ï´Ù. |
JMenuItem |
add (String s)
ÁöÁ¤µÈ ÅØ½ºÆ®¸¦ °¡Áö´Â »õ·Î¿î ¸Þ´º Ç׸ñÀ» ÀÛ¼ºÇØ, ÀÌ ¸Þ´ºÀÇ ¸»¹Ì¿¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addPopupMenuListener (PopupMenuListener l)
PopupMenu ûÃëÀÚ¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
addSeparator ()
¸Þ´ºÀÇ ¸»¹Ì¿¡ »õ·Î¿î separator¸¦ Ãß°¡ÇÕ´Ï´Ù. |
protected PropertyChangeListener |
createActionChangeListener (JMenuItem b)
Action ¿¡ ´ëÇÑ º¯°æÀÌ ¹ß»ýÇßÀ» °æ¿ì¿¡ ÄÁÆ®·ÑÀ» °»½ÅÇÑ´Ù, ÀûÀýÈ÷ ¼³Á¤µÈ PropertyChangeListener ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
protected JMenuItem |
createActionComponent (Action a)
JPopupMenu ¿¡ Ãß°¡µÈ Action ÀÇ JMenuItem ¸¦ ÀÛ¼ºÇÏ´Â ÆÑÅ丮 ¸Þ¼ÒµåÀÔ´Ï´Ù. |
protected void |
firePopupMenuCanceled ()
PopupMenuListener ¿¡, pop-up menu°¡ »èÁ¦µÈ °ÍÀ» ÅëÁöÇÕ´Ï´Ù. |
protected void |
firePopupMenuWillBecomeInvisible ()
PopupMenuListener ¿¡, pop-up menu°¡ ºÒ°¡½Ã°¡ µÇ´Â °ÍÀ» ÅëÁöÇÕ´Ï´Ù. |
protected void |
firePopupMenuWillBecomeVisible ()
PopupMenuListener ¿¡, pop-up menu°¡ °¡½Ã°¡ µÇ´Â °ÍÀ» ÅëÁöÇÕ´Ï´Ù. |
AccessibleContext |
getAccessibleContext ()
ÀÌ JPopupMenu ¿¡ °ü·ÃÇÑ AccessibleContext ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Component |
getComponent ()
ÀÌ JPopupMenu ÄÄÆÛ³ÍÆ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Component |
getComponentAtIndex (int i)
Ãßõ µÇ°í ÀÖÁö ¾Ê½À´Ï´Ù. getComponent(int i) ·Î ¿Å°ÜÁ³½À´Ï´Ù. |
int |
getComponentIndex (Component c)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ À妽º¸¦ µ¹·ÁÁÝ´Ï´Ù. |
static boolean |
getDefaultLightWeightPopupEnabled ()
defaultLightWeightPopupEnabled ÇÁ·ÎÆÛƼ¸¦ ÃëµæÇÕ´Ï´Ù. |
Component |
getInvoker ()
pop-up menuÀÇ È£Ãâ ÄÄÆÛ³ÍÆ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
String |
getLabel ()
pop-up menuÀÇ label¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Insets |
getMargin ()
pop-up menuÀÇ º¸´õ¿Í ³»¿ëÀÇ »çÀÌ¿¡ ÀÖ´Â ¸¶ÁøÀÇ °ªÀ» µ¹·ÁÁÝ´Ï´Ù (Çȼ¿ ´ÜÀ§). |
PopupMenuListener [] |
getPopupMenuListeners ()
ÀÌ JMenuItem ¿¡ addPopupMenuListener()·Î Ãß°¡µÈ ¸ðµç PopupMenuListener ÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
SingleSelectionModel |
getSelectionModel ()
´ÜÀÏÀÇ ¼±ÅÃÀ» Ãë±ÞÇÏ´Â ¸ðµ¨ ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
MenuElement [] |
getSubElements ()
ÀÌ ¸Þ´º ÄÄÆÛ³ÍÆ®ÀÇ ºÎ¸Þ´º¸¦ ÀúÀåÇÏ´Â MenuElement ÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
PopupMenuUI |
getUI ()
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ Ç¥Çö ÇÏ´Â Look & Feel (L&F) ¿ÀºêÁ§Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
String |
getUIClassID ()
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ Ç¥Çö ÇÏ´Â L&F Ŭ·¡½ºÀÇ À̸§À» µ¹·ÁÁÝ´Ï´Ù. |
void |
insert (Action a,
int index)
ÁöÁ¤µÈ Action ¿ÀºêÁ§Æ®¸¦, ¸Þ´º Ç׸ñÀ¸·Î¼ ÁöÁ¤ÀÇ À§Ä¡¿¡ »ðÀÔÇÕ´Ï´Ù. |
void |
insert (Component component,
int index)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦, ¸Þ´ºÀÇ ÁöÁ¤µÈ À§Ä¡¿¡ »ðÀÔÇÕ´Ï´Ù. |
boolean |
isBorderPainted ()
º¸´õ¸¦ paint ÇÒÁö ¾î¶³Áö¸¦ Á¶»çÇÕ´Ï´Ù. |
boolean |
isLightWeightPopupEnabled ()
lightWeightPopupEnabled ÇÁ·ÎÆÛƼ¸¦ ÃëµæÇÕ´Ï´Ù. |
boolean |
isPopupTrigger (MouseEvent e)
JPopupMenu ÀÇ ÇöÀç ÀνºÅç µÇ°í ÀÖ´Â UI °¡ MouseEvent ¸¦ pop-up ¹æ¾Æ¼è¶ó°í º¸´Â °æ¿ì´Â true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
boolean |
isVisible ()
pop-up menu°¡ °¡½Ã (ÇöÀç Ç¥½ÃÁß)ÀÎ °æ¿ì¿¡ true ¸¦ µ¹·ÁÁÝ´Ï´Ù. |
void |
menuSelectionChanged (boolean isIncluded)
ÀÌ ¸Þ´º¸¦ ¾×ƼºêÇÏ°Ô ÇÏ´ÂÁö ¾×ƼºêÇÏÁö ¾Ê°Ô Çϱâ À§Çؼ µµ±¸¸ðÀ½ÀÇ ¼±ÅÃÀÌ º¯°æµÇ¾úÀ» ¶§¿¡, ¸Þ¼¼Áö¸¦ º¸³À´Ï´Ù. |
void |
pack ()
ÄÁÅ×À̳ʸ¦ ·¹À̾ƿô ÇØ, ³»¿ëÀÇ Ç¥½Ã¿¡ ÃÖ¼ÒÇÑÀÇ °ø°£À» »ç¿ëÇϵµ·Ï(µíÀÌ) ÇÕ´Ï´Ù. |
protected void |
paintBorder (Graphics g)
borderPainted ÇÁ·ÎÆÛƼ°¡ true ÀÎ °æ¿ì¿¡, pop-up menuÀÇ º¸´õ¸¦ paint ÇÕ´Ï´Ù. |
protected String |
paramString ()
ÀÌ JPopupMenu ÀÇ Ä³¸¯ÅÍ ¶óÀΠǥÇöÀ» µ¹·ÁÁÝ´Ï´Ù. |
protected void |
processFocusEvent (FocusEvent evt)
ÀÌ ÄÄÆÛ³ÍÆ®·Î ¹ß»ýÇÏ´Â Æ÷Ä¿½º À̺¥Æ®¸¦, µî·ÏµÇ¾î ¸ðµç FocusListener ¿ÀºêÁ§Æ®¿¡ µð½ºÆÌÄ¡ ÇÏ´Â °ÍÀ¸·Î½á ó¸®ÇÕ´Ï´Ù.
|
protected void |
processKeyEvent (KeyEvent evt)
¹«¸ °üÀý ¸ð´ÖÅ©³ª °¡¼Ó±âµîÀÇ, Ű½ºÆ®·ÎÅ©(keystroke) À̺¥Æ®¸¦ ó¸®ÇÕ´Ï´Ù. |
void |
processKeyEvent (KeyEvent e,
MenuElement [] path,
MenuSelectionManager manager)
ÀÌ ¸Þ¼Òµå´Â MenuElement ÀÎÅÍÆäÀ̽º¿¡ ÀûÇÕÇϱâ À§Çؼ ÇÊ¿äÇÕ´Ï´Ù¸¸, ±¸ÇöµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù. |
void |
processMouseEvent (MouseEvent event,
MenuElement [] path,
MenuSelectionManager manager)
ÀÌ ¸Þ¼Òµå´Â MenuElement ÀÎÅÍÆäÀ̽º¿¡ ÀûÇÕÇϱâ À§Çؼ ÇÊ¿äÇÕ´Ï´Ù¸¸, ±¸ÇöµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù. |
void |
remove (int pos)
ÁöÁ¤µÈ À妽º¿¡ ÀÖ´Â ÄÄÆÛ³ÍÆ®¸¦ ÀÌ pop-up menu·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
void |
removePopupMenuListener (PopupMenuListener l)
PopupMenu ûÃëÀÚ¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
setBorderPainted (boolean b)
º¸´õ¸¦ paint ÇÒÁö ¾î¶³Áö¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
static void |
setDefaultLightWeightPopupEnabled (boolean aFlag)
lightWeightPopupEnabled ÇÁ·ÎÆÛƼÀÇ µðÆúÆ® °ª¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setInvoker (Component invoker)
pop-up menuÀÇ È£Ãâ ÄÄÆÛ³ÍÆ®, Áï, pop-up menu Ç׸ñÀÌ Ç¥½ÃµÇ´Â ÄÄÆÛ³ÍÆ®¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setLabel (String label)
pop-up menuÀÇ label¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setLightWeightPopupEnabled (boolean aFlag)
lightWeightPopupEnabled ÀÇ µðÆúÆ® °ª¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setLocation (int x,
int y)
x, y ÁÂÇ¥¸¦ »ç¿ëÇØ, pop-up menuÀÇ Á»󱸼®ÀÇ À§Ä¡¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setPopupSize (Dimension d)
Dimension ¿ÀºêÁ§Æ®¸¦ »ç¿ëÇØ, pop-up À©µµ¿ìÀÇ »çÀÌÁ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setPopupSize (int width,
int height)
pop-up À©µµ¿ìÀÇ »çÀÌÁ, ÁöÁ¤µÈ Æø ¹× ³ôÀÌ·Î ¼³Á¤ÇÕ´Ï´Ù. |
void |
setSelected (Component sel)
ÇöÀç ¼±ÅõǴ ÄÄÆÛ³ÍÆ®¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setSelectionModel (SingleSelectionModel model)
´ÜÀÏÀÇ ¼±ÅÃÀ» Ãë±ÞÇÏ´Â ¸ðµ¨ ¿ÀºêÁ§Æ®¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setUI (PopupMenuUI ui)
ÀÌ ÄÄÆÛ³ÍÆ®¸¦ Ç¥Çö ÇÏ´Â L&F ¿ÀºêÁ§Æ®¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setVisible (boolean b)
pop-up menuÀÇ °¡½Ã¼ºÀ» ¼³Á¤ÇÕ´Ï´Ù. |
void |
show (Component invoker,
int x,
int y)
È£Ãâ ÄÄÆÛ³ÍÆ®³»ÀÇ x, y ÁÂÇ¥·Î ÁöÁ¤µÈ À§Ä¡¿¡, pop-up menu¸¦ Ç¥½ÃÇÕ´Ï´Ù. |
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 , removeAll , removeContainerListener , setFocusCycleRoot , setFocusTraversalKeys , setFocusTraversalPolicy , setLayout , transferFocusBackward , transferFocusDownCycle , validate , validateTree |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
»ý¼ºÀÚÀÇ »ó¼¼ |
public JPopupMenu()
JPopupMenu
¸¦ ±¸ÃàÇÕ´Ï´Ù.
public JPopupMenu(String label)
PopupMenu
¸¦ ±¸ÃàÇÕ´Ï´Ù.
label
- pop-up menuÀÇ Å¸ÀÌÆ²·Î¼ UI °¡ »ç¿ëÇϴ ij¸¯ÅÍ ¶óÀθ޼ҵåÀÇ »ó¼¼ |
public static void setDefaultLightWeightPopupEnabled(boolean aFlag)
lightWeightPopupEnabled
ÇÁ·ÎÆÛƼÀÇ µðÆúÆ® °ª¸¦ ¼³Á¤ÇÕ´Ï´Ù.
aFlag
- pop-up°¡ °æ·®ÀÇ °æ¿ì´Â true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
getDefaultLightWeightPopupEnabled()
,
setLightWeightPopupEnabled(boolean)
public static boolean getDefaultLightWeightPopupEnabled()
defaultLightWeightPopupEnabled
ÇÁ·ÎÆÛƼ¸¦ ÃëµæÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â true
ÀÔ´Ï´Ù.
defaultLightWeightPopupEnabled
ÇÁ·ÎÆÛƼÀÇ °ªsetDefaultLightWeightPopupEnabled(boolean)
public PopupMenuUI getUI()
PopupMenuUI
¿ÀºêÁ§Æ®public void setUI(PopupMenuUI ui)
ui
- ½Å±Ô PopupMenuUI
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)
protected void processFocusEvent(FocusEvent evt)
Component
ÀÇ ±â¼ú: FocusListener
¿ÀºêÁ§Æ®¿¡ µð½ºÆÌÄ¡ ÇÏ´Â °ÍÀ¸·Î½á ó¸®ÇÕ´Ï´Ù.
ÀÌ ÄÄÆÛ³ÍÆ®¿¡ ´ëÇØ¼ Æ÷Ä¿½º À̺¥Æ®°¡ »ç¿ë °¡´ÉÇÏÁö ¾ÊÀº °æ¿ì, ÀÌ ¸Þ¼Òµå´Â ºÒ·Á °¡Áö ¾Ê½À´Ï´Ù. Æ÷Ä¿½º À̺¥Æ®´Â ´ÙÀ½ÀÇ ¾î¶² °ÍÀΰ¡ÀÇ °æ¿ì¿¡ »ç¿ë °¡´ÉÇÏ°Ô µË´Ï´Ù.
FocusListener
¿ÀºêÁ§Æ®°¡ addFocusListener
¿¡ ÀÇÇØ µî·ÏµÇ¾î ÀÖ´Ù
enableEvents
¿¡ ÀÇÇØ Æ÷Ä¿½º À̺¥Æ®°¡ »ç¿ë °¡´ÉÇÏ°Ô µÇ¾î ÀÖ´Ù
À̺¥Æ® ÆÄ¶ó¹ÌÅͰ¡ null
ÀÇ °æ¿ìÀÇ µ¿ÀÛÀº Á¤ÀǵǾî ÀÖÁö ¾Ê±â ¶§¹®¿¡ ¿¹¿Ü°¡ ½½·Î¿ì µË´Ï´Ù.
Component
³»ÀÇ processFocusEvent
evt
- Æ÷Ä¿½º À̺¥Æ®FocusEvent
,
FocusListener
,
Component.addFocusListener(java.awt.event.FocusListener)
,
Component.enableEvents(long)
protected void processKeyEvent(KeyEvent evt)
JComponent
³»ÀÇ processKeyEvent
evt
- ó¸®µÇ´Â Ű À̺¥Æ®KeyEvent
,
KeyListener
,
Component.addKeyListener(java.awt.event.KeyListener)
,
Component.enableEvents(long)
,
Component.isShowing()
public SingleSelectionModel getSelectionModel()
selectionModel
ÇÁ·ÎÆÛƼSingleSelectionModel
public void setSelectionModel(SingleSelectionModel model)
model
- ½Å±Ô SingleSelectionModel
SingleSelectionModel
public JMenuItem add(JMenuItem menuItem)
JMenuItem
public JMenuItem add(String s)
s
- Ãß°¡µÇ´Â ¸Þ´º Ç׸ñÀÇ Ä³¸¯ÅÍ ¶óÀÎpublic JMenuItem add(Action a)
Action
¿ÀºêÁ§Æ®¸¦ µð½ºÆÌÄ¡ ÇÏ´Â ¸Þ´ºÀÇ ¸»¹Ì¿¡ »õ·Î¿î ¸Þ´º Ç׸ñÀ» Ãß°¡ÇÕ´Ï´Ù. JDK 1.3 ÀÌÈÄ´Â ÀÌ ¸Þ¼Òµå´Â ÄÁÅ×À̳ʿ¡ Action
¸¦ Ãß°¡ÇÏ´Â ¸Þ¼Òµå·Î¼´Â Ãßõ µÇÁö ¾Ê½À´Ï´Ù. ´ë½Å¿¡,setAction
¸¦ »ç¿ëÇØ ¾×¼ÇÀ» °¡Áö´Â ÄÁÆ®·ÑÀ» ¼³Á¤ÇØ, ±× ÄÁÆ®·ÑÀ» Á÷Á¢ Container
¿¡ Ãß°¡ÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
a
- ¸Þ´º¿¡ Ãß°¡ÇÏ´Â Action
Action
protected JMenuItem createActionComponent(Action a)
JPopupMenu
¿¡ Ãß°¡µÈ Action
ÀÇ JMenuItem
¸¦ ÀÛ¼ºÇÏ´Â ÆÑÅ丮 ¸Þ¼ÒµåÀÔ´Ï´Ù. JDK 1.3 ÀÌÈÄ´Â ÀÌ ¸Þ¼Òµå´Â Ãßõ µÇÁö ¾Ê½À´Ï´Ù. ´ë½Å¿¡,setAction
¸¦ »ç¿ëÇØ ¾×¼ÇÀ» °¡Áö´Â ÄÁÆ®·ÑÀ» ¼³Á¤ÇØ, ±× ÄÁÆ®·ÑÀ» Á÷Á¢ Container
¿¡ Ãß°¡ÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
a
- Ãß°¡µÇ´Â ¸Þ´º Ç׸ñÀÇ Action
Action
protected PropertyChangeListener createActionChangeListener(JMenuItem b)
Action
¿¡ ´ëÇÑ º¯°æÀÌ ¹ß»ýÇßÀ» °æ¿ì¿¡ ÄÁÆ®·ÑÀ» °»½ÅÇÑ´Ù, ÀûÀýÈ÷ ¼³Á¤µÈ PropertyChangeListener
¸¦ µ¹·ÁÁÝ´Ï´Ù. JDK 1.3 ÀÌÈÄ´Â ÀÌ ¸Þ¼Òµå´Â ÄÁÅ×À̳ʿ¡ Action
¸¦ Ãß°¡ÇÏ´Â ¸Þ¼Òµå·Î¼´Â Ãßõ µÇÁö ¾Ê½À´Ï´Ù. ´ë½Å¿¡,setAction
¸¦ »ç¿ëÇØ ¾×¼ÇÀ» °¡Áö´Â ÄÁÆ®·ÑÀ» ¼³Á¤ÇØ, ±× ÄÁÆ®·ÑÀ» Á÷Á¢ Container
¿¡ Ãß°¡ÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
public void remove(int pos)
Container
³»ÀÇ remove
pos
- »èÁ¦µÇ´Â Ç׸ñÀÇ À§Ä¡
IllegalArgumentException
- pos
ÀÇ °ªÀÌ 0 º¸´Ù ÀÛÀºÁö pos
ÀÇ °ªÀÌ ¸Þ´º Ç׸ñÀÇ ¼öº¸´Ù Å« °æ¿ìContainer.add(java.awt.Component)
public void setLightWeightPopupEnabled(boolean aFlag)
lightWeightPopupEnabled
ÀÇ µðÆúÆ® °ª¸¦ ¼³Á¤ÇÕ´Ï´Ù. µðÆúÆ®¿¡¼´Â true
ÀÔ´Ï´Ù. Look & Feel °¡ pop-up¸¦ Ç¥½ÃÇÒ ¶§, µðÆúÆ®¿¡¼´Â °æ·® (¸ðµÎ Java ÀÇ) pop-upÀÇ »ç¿ëÀ» ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. °æ·® pop-up À©µµ¿ì´Â Áß·® (³×ÀÌÆ¼ºê ÇǾîÀÇ) À©µµ¿ìº¸´Ù È¿À²ÀûÀÔ´Ï´Ù¸¸, °æ·® ÄÄÆÛ³ÍÆ®¿Í Áß·® ÄÄÆÛ³ÍÆ®¸¦ GUI Áß(¾È)¿¡¼ È¥Àç½ÃÄѼ´Â ¾ÈµË´Ï´Ù. ¾îÇø®ÄÉÀ̼ÇÀ¸·Î °æ·® ÄÄÆÛ³ÍÆ®¿Í Áß·® ÄÄÆÛ³ÍÆ®°¡ È¥ÀçÇϰí ÀÖ´Â °æ¿ì´Â °æ·® pop-up¸¦ ¹«È¿·Î ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. ÀÌ ÇÁ·ÎÆÛƼÀÇ °ª¿¡ °ü°è¾øÀÌ, Ç×»ó Áß·® pop-up¸¦ »ç¿ëÇÏ´Â Look & Feel µµ ÀÖ½À´Ï´Ù.
aFlag
- °æ·® pop-up¸¦ ¹«È¿·Î ÇÏ´Â °æ¿ì´Â false
isLightWeightPopupEnabled
public boolean isLightWeightPopupEnabled()
lightWeightPopupEnabled
ÇÁ·ÎÆÛƼ¸¦ ÃëµæÇÕ´Ï´Ù.
lightWeightPopupEnabled
ÇÁ·ÎÆÛƼÀÇ °ªsetLightWeightPopupEnabled(boolean)
public String getLabel()
setLabel(java.lang.String)
public void setLabel(String label)
label
- pop-up menuÀÇ label¸¦ ÁöÁ¤Çϴ ij¸¯ÅÍ ¶óÀÎsetLabel(java.lang.String)
public void addSeparator()
public void insert(Action a, int index)
Action
¿ÀºêÁ§Æ®¸¦, ¸Þ´º Ç׸ñÀ¸·Î¼ ÁöÁ¤ÀÇ À§Ä¡¿¡ »ðÀÔÇÕ´Ï´Ù.
a
- »ðÀÔÇÏ´Â Action
¿ÀºêÁ§Æ®index
- Action
¸¦ »ðÀÔÇÏ´Â À§Ä¡. 0 Àº ¸Þ´ºÀÇ ¼±µÎ
IllegalArgumentException
- index
ÀÇ °ªÀÌ 0 º¸´Ù ÀÛÀº °æ¿ìAction
public void insert(Component component, int index)
component
- »ðÀÔÇÏ´Â Component
index
- ÄÄÆÛ³ÍÆ®¸¦ »ðÀÔÇÏ´Â À§Ä¡. 0 Àº ¸Þ´ºÀÇ ¼±µÎ
IllegalArgumentException
- index
ÀÇ °ªÀÌ 0 º¸´Ù ÀÛÀº °æ¿ìpublic void addPopupMenuListener(PopupMenuListener l)
PopupMenu
ûÃëÀÚ¸¦ Ãß°¡ÇÕ´Ï´Ù.
l
- Ãß°¡ÇÏ´Â PopupMenuListener
public void removePopupMenuListener(PopupMenuListener l)
PopupMenu
ûÃëÀÚ¸¦ »èÁ¦ÇÕ´Ï´Ù.
l
- »èÁ¦ÇÏ´Â PopupMenuListener
public PopupMenuListener [] getPopupMenuListeners()
PopupMenuListener
ÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù.
PopupMenuListener
. Ãß°¡µÈ ûÃëÀÚ°¡ ¾ø´Â °æ¿ì´Â ÇÏ´ÃÀÇ ¹è¿protected void firePopupMenuWillBecomeVisible()
PopupMenuListener
¿¡, pop-up menu°¡ °¡½Ã°¡ µÇ´Â °ÍÀ» ÅëÁöÇÕ´Ï´Ù.
protected void firePopupMenuWillBecomeInvisible()
PopupMenuListener
¿¡, pop-up menu°¡ ºÒ°¡½Ã°¡ µÇ´Â °ÍÀ» ÅëÁöÇÕ´Ï´Ù.
protected void firePopupMenuCanceled()
PopupMenuListener
¿¡, pop-up menu°¡ »èÁ¦µÈ °ÍÀ» ÅëÁöÇÕ´Ï´Ù.
public void pack()
public void setVisible(boolean b)
JComponent
³»ÀÇ setVisible
b
- pop-up¸¦ °¡½Ã·Î ÇÏ´Â °æ¿ì´Â true, ¼û±â´Â °æ¿ì´Â falsepublic boolean isVisible()
Component
³»ÀÇ isVisible
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
Component.setVisible(boolean)
public void setLocation(int x, int y)
Component
³»ÀÇ setLocation
x
- pop-up menuÀÇ »õ·Î¿î À§Ä¡ÀÇ x ÁÂÇ¥y
- pop-up menuÀÇ »õ·Î¿î À§Ä¡ÀÇ y ÁÂÇ¥Component.getLocation()
,
Component.setBounds(int, int, int, int)
public Component getInvoker()
Component
public void setInvoker(Component invoker)
invoker
- pop-up menu°¡ Ç¥½ÃµÇ´Â Component
public void show(Component invoker, int x, int y)
invoker
- pop-up menu°¡ Ç¥½ÃµÇ´Â ÄÄÆÛ³ÍÆ®x
- pop-up menu¸¦ Ç¥½ÃÇϴ ȣÃâ ÄÄÆÛ³ÍÆ®ÀÇ x ÁÂÇ¥y
- pop-up menu¸¦ Ç¥½ÃÇϴ ȣÃâ ÄÄÆÛ³ÍÆ®ÀÇ y ÁÂÇ¥public Component getComponentAtIndex(int i)
getComponent(int i)
·Î ¿Å°ÜÁ³½À´Ï´Ù.
i
- ÄÄÆÛ³ÍÆ®ÀÇ À妽º. 0 ÀÌ ¼±µÎ
Component
public int getComponentIndex(Component c)
public void setPopupSize(Dimension d)
Dimension
¿ÀºêÁ§Æ®¸¦ »ç¿ëÇØ, pop-up À©µµ¿ìÀÇ »çÀÌÁ ¼³Á¤ÇÕ´Ï´Ù. À̰ÍÀº setPreferredSize(d)
¿Í µ¿µîÇÕ´Ï´Ù.
d
- ÀÌ ÄÄÆÛ³ÍÆ®ÀÇ »õ·Î¿î »çÀÌÁ ÁöÁ¤ÇÏ´Â Dimension
public void setPopupSize(int width, int height)
setPreferredSize(new Dimension(width, height))
¿¡ »ó´çÇÕ´Ï´Ù.
public void setSelected(Component sel)
sel
- ¼±ÅÃÇÏ´Â Component
public boolean isBorderPainted()
setBorderPainted(boolean)
public void setBorderPainted(boolean b)
b
- true ÀÇ °æ¿ì´Â º¸´õ°¡ paint µÇ´ÂisBorderPainted()
protected void paintBorder(Graphics g)
borderPainted
ÇÁ·ÎÆÛƼ°¡ true
ÀÎ °æ¿ì¿¡, pop-up menuÀÇ º¸´õ¸¦ paint ÇÕ´Ï´Ù.
JComponent
³»ÀÇ paintBorder
g
- Graphics
¿ÀºêÁ§Æ®JComponent.paint(java.awt.Graphics)
,
JComponent.setBorder(javax.swing.border.Border)
public Insets getMargin()
Insets
¿ÀºêÁ§Æ®protected String paramString()
JPopupMenu
ÀÇ Ä³¸¯ÅÍ ¶óÀΠǥÇöÀ» µ¹·ÁÁÝ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â µð¹ö±× Àü¿ëÀ̸ç, µ¹·ÁÁÖ¾îÁö´Â ij¸¯ÅÍ ¶óÀÎÀÇ ³»¿ë ¹× Çü½ÄÀº ±¸Çö¿¡ µû¶ó¼ ´Ù¸¨´Ï´Ù. µ¹·ÁÁÖ¾îÁö´Â ij¸¯ÅÍ ¶óÀÎÀº ºñ¾úÀ» °æ¿ì°¡ ÀÖ½À´Ï´Ù¸¸,null
·Î´Â µÇÁö ¾Ê½À´Ï´Ù.
JComponent
³»ÀÇ paramString
JPopupMenu
ÀÇ Ä³¸¯ÅÍ ¶óÀΠǥÇöpublic AccessibleContext getAccessibleContext()
Accessible
³»ÀÇ getAccessibleContext
JComponent
³»ÀÇ getAccessibleContext
public void processMouseEvent(MouseEvent event, MenuElement [] path, MenuSelectionManager manager)
MenuElement
ÀÎÅÍÆäÀ̽º¿¡ ÀûÇÕÇϱâ À§Çؼ ÇÊ¿äÇÕ´Ï´Ù¸¸, ±¸ÇöµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.
MenuElement
³»ÀÇ processMouseEvent
MenuElement.processMouseEvent(MouseEvent, MenuElement[], MenuSelectionManager)
public void processKeyEvent(KeyEvent e, MenuElement [] path, MenuSelectionManager manager)
MenuElement
ÀÎÅÍÆäÀ̽º¿¡ ÀûÇÕÇϱâ À§Çؼ ÇÊ¿äÇÕ´Ï´Ù¸¸, ±¸ÇöµÇ°í ÀÖÁö ¾Ê½À´Ï´Ù.
MenuElement
³»ÀÇ processKeyEvent
MenuElement.processKeyEvent(KeyEvent, MenuElement[], MenuSelectionManager)
public void menuSelectionChanged(boolean isIncluded)
javax.swing.MenuElement
ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇÕ´Ï´Ù. MenuElement.menuSelectionChanged ¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ ÁÖ¼¼¿ä.
- Á¤ÀÇ:
- ÀÎÅÍÆäÀ̽º
MenuElement
³»ÀÇ menuSelectionChanged
- ÆÄ¶ó¹ÌÅÍ:
isIncluded
- ÀÌ ¸Þ´º°¡ ¾×ƼºêÇÑ °æ¿ì´Â true, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false- °ü·Ã Ç׸ñ:
MenuElement.menuSelectionChanged(boolean)
public MenuElement [] getSubElements()
MenuElement
ÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. JMenuElement
ÀÎÅÍÆäÀ̽º¿¡ ÀûÇÕÇÏ´Â Ç׸ñ¸¸À» µ¹·ÁÁÝ´Ï´Ù. pop-up menu°¡ null
ÀÇ °æ¿ì´Â ÇÏ´ÃÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â MenuElement
ÀÎÅÍÆäÀ̽º¿¡ ÀûÇÕÇϱâ À§Çؼ ÇÊ¿äÇÕ´Ï´Ù.
MenuElement
³»ÀÇ getSubElements
MenuElement
¿ÀºêÁ§Æ®ÀÇ ¹è¿MenuElement.getSubElements()
public Component getComponent()
JPopupMenu
ÄÄÆÛ³ÍÆ®¸¦ µ¹·ÁÁÝ´Ï´Ù.
MenuElement
³»ÀÇ getComponent
JPopupMenu
¿ÀºêÁ§Æ®MenuElement.getComponent()
public boolean isPopupTrigger(MouseEvent e)
JPopupMenu
ÀÇ ÇöÀç ÀνºÅç µÇ°í ÀÖ´Â UI °¡ MouseEvent
¸¦ pop-up ¹æ¾Æ¼è¶ó°í º¸´Â °æ¿ì´Â true ¸¦ µ¹·ÁÁÝ´Ï´Ù.
|
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.