|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--java.awt.Component | +--java.awt.Button
ÀÌ Å¬·¡½º´Â label ÷ºÎ ¹öưÀ» »ý¼ºÇÕ´Ï´Ù. ¾îÇø®ÄÉÀ̼ÇÀº ¹öưÀÌ ´·ÈÀ» ¶§¿¡ ¾×¼ÇÀÌ ½ÇÇàµÇµµ·Ï(µíÀÌ) ÇÒ ¼ö°¡ ÀÖ½À´Ï´Ù. ÀÌ À̹ÌÁö´Â Solaris operating system·Î Ç¥½ÃµÇ´Â Quit
¹öưÀÇ 3 °³ÀÇ ºä¸¦ ³ªÅ¸³À´Ï´Ù.
1 ¹øÂ°ÀÇ ºä´Â Åë»ó »óÅÂÀÇ ¹öưÀ» ³ªÅ¸³À´Ï´Ù. 2 ¹øÂ°ÀÇ ºä´Â ÀÔ·ÂÃÊÁ¡ÀÌ ÀÖÀ» ¶§ÀÇ ¹öưÀ» ³ªÅ¸³À´Ï´Ù. ¹öưÀÇ À±°ûÀº ¾îµÎ¿öÁ®, ¾×ƼºêÇÑ ¿ÀºêÁ§Æ®ÀÎ °ÍÀ» À¯Àú¿¡°Ô ³ªÅ¸³À´Ï´Ù. 3 ¹øÂ°ÀÇ ºä´Â À¯Àú°¡ ¹öư À§¿¡¼ ¸¶¿ì½º¸¦ Ŭ¸¯ÇØ, ¾×¼ÇÀÇ ½ÇÇàÀ» ¿ä±¸ÇßÀ» ¶§ÀÇ ¹öưÀ» ³ªÅ¸³À´Ï´Ù.
¸¶¿ì½º¸¦ »ç¿ëÇØ ¹öưÀ» Ŭ¸¯ÇÏ´Â Á¦½ºÃß¾î´Â ¸¶¿ì½º°¡ ¹öư»ó¿¡¼ ¹Ð·Á ¶¼¾î ³õ¾ÆÁ³À» ¶§¿¡ ¼Û½ÅµÇ´Â ActionEvent
ÀÇ ÀνºÅϽº¿¡ °ü·ÃÁöÀ» ¼ö ÀÖ°í ÀÖ½À´Ï´Ù. ¾ðÁ¦ ¹öưÀÌ ¹Ð·È´ÂÁöÀÇ ÅëÁö´Â ÇÊ¿äÇÏÁö¸¸, ¾ðÁ¦ ¶¼¾î ³õ¾ÆÁ³´ÂÁöÀÇ ÅëÁö´Â ÇÊ¿äÇÏÁö ¾ÊÀº °æ¿ì, ¾îÇø®ÄÉÀ̼ÇÀº µ¶¸³ÇÑ µ¿ÀÛÀ¸·Î¼ processMouseEvent
¸¦ Ư¼öÈ ÇÏ´Â Àϵµ,addMouseListener
¸¦ È£ÃâÇÏ´Â °ÍÀ¸·Î ¸¶¿ì½º À̺¥Æ®ÀÇ Ã»ÃëÀڷμ ÀÚ½ÅÀ» µî·ÏÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ÀÌ·¯ÇÑ ¸Þ¼Òµå´Â ¾çÂÊ ¸ðµÎ, ¸ðµç ÄÄÆÛ³ÍÆ®ÀÇ Ãß»ó ½´ÆÛ Ŭ·¡½ºÀÎ Component
¿¡ ÀÇÇØ Á¤Àǵ˴ϴÙ.
¹öưÀÌ ¹Ð·Á ¶¼¾î ³õ¾ÆÁö¸é(ÀÚ), AWT ´Â ¹öưÀÇ processEvent
¸¦ È£ÃâÇÏ´Â °ÍÀ¸·Î, ¹öư¿¡ ActionEvent
ÀÇ ÀνºÅϽº¸¦ º¸³À´Ï´Ù. ¹öưÀÇ processEvent
¸Þ¼Òµå´Â ±× ¹öưÀÇ ¸ðµç À̺¥Æ®¸¦ ¹Þ½À´Ï´Ù. ¹öưÀº ÀÚ½ÅÀÇ processActionEvent
¸Þ¼Òµå¸¦ È£ÃâÇÏ´Â °Í¿¡ ÀÇÇØ ¾×¼Ç À̺¥Æ®¸¦ °Ç³×ÁÝ´Ï´Ù. processActionEvent
¸Þ¼Òµå´Â ÀÌ ¹öư¿¡ ÀÇÇØ »ý¼ºµÇ´Â ¾×¼Ç À̺¥Æ®ÀÇ ÅëÁö¸¦ ´ë»óÀ¸·Î ÇØ µî·ÏµÇ¾î ÀÖ´Â ¾×¼Ç ûÃëÀÚ¿¡°Ô ¾×¼Ç À̺¥Æ®¸¦ °Ç³×ÁÝ´Ï´Ù.
¹Ð·Á ¶¼¾î ³õ¾ÆÁö´Â ¹öư¿¡ ±Ù°ÅÇØ ¾×¼ÇÀ» ½ÇÇàÇÏ´Â °æ¿ì, ¾îÇø®ÄÉÀ̼ÇÀº ActionListener
¸¦ ±¸ÇöÇØ, ¹öưÀÇ addActionListener
¸Þ¼Òµå¸¦ È£ÃâÇÏ´Â °ÍÀ¸·Î, ÀÌ ¹öưÀ¸·ÎºÎÅÍ À̺¥Æ®¸¦ ¹Þµµ·Ï(µíÀÌ) »õ·Î¿î ûÃëÀÚ¸¦ µî·ÏÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. ¾îÇø®ÄÉÀ̼ÇÀº ¹öưÀÇ ¾×¼Ç Ä¿¸àµå¸¦ ¸Þ¼¼Áö ÇÁ·ÎÅäÄݷμ »ç¿ëÇÕ´Ï´Ù.
ActionEvent
,
ActionListener
,
Component.processMouseEvent(java.awt.event.MouseEvent)
,
Component.addMouseListener(java.awt.event.MouseListener)
,
Á÷·ÄÈ µÈ Çü½Ä ÁßøµÈ Ŭ·¡½ºÀÇ °³¿ä | |
protected class |
Button.AccessibleAWTButton
ÀÌ Å¬·¡½º´Â Button Ŭ·¡½º¿ëÀÇ À¯Àú º¸Á¶ ±â´ÉÀÇ ¼Æ÷Æ®¸¦ ±¸ÇöÇϰí ÀÖ½À´Ï´Ù. |
Ŭ·¡½º java.awt. Component À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
Component.BltBufferStrategy , Component.FlipBufferStrategy |
ÇʵåÀÇ °³¿ä |
Ŭ·¡½º 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 |
»ý¼ºÀÚÀÇ °³¿ä | |
Button ()
label ¾øÀ½ÀÇ ¹öưÀ» ±¸ÃàÇÕ´Ï´Ù. |
|
Button (String label)
ÁöÁ¤µÈ label¸¦ °¡Áö´Â ¹öưÀ» ±¸ÃàÇÕ´Ï´Ù. |
¸Þ¼ÒµåÀÇ °³¿ä | |
void |
addActionListener (ActionListener l)
ÀÌ ¹öưÀ¸·ÎºÎÅÍ ¾×¼Ç À̺¥Æ®¸¦ ¹Þ±â À§Çؼ(¶§¹®¿¡), ÁöÁ¤µÈ ¾×¼Ç ûÃëÀÚ¸¦ Ãß°¡ÇÕ´Ï´Ù. |
void |
addNotify ()
¹öưÀÇ ÇǾ ±¸ÃàÇÕ´Ï´Ù. |
AccessibleContext |
getAccessibleContext ()
ÀÌ Button ¿¡ °ü·ÃÁöÀ» ¼ö ÀÖ´Â AccessibleContext ¸¦ ÃëµæÇÕ´Ï´Ù. |
String |
getActionCommand ()
ÀÌ ¹öưÀ¸·Î ¹æ¾Æ¼è µÇ´Â ¾×¼Ç À̺¥Æ®ÀÇ Ä¿¸àµå¸íÀ» µ¹·ÁÁÝ´Ï´Ù. |
ActionListener [] |
getActionListeners ()
ÀÌ ¹öư¿¡ µî·ÏµÇ¾î ¸ðµç ¾×¼Ç ûÃëÀÚÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
String |
getLabel ()
¹öưÀÇ label¸¦ µ¹·ÁÁÝ´Ï´Ù. |
EventListener [] |
getListeners (Class listenerType)
ÀÌ Button ¿¡ FooListener ·Î¼ ÇöÀç µî·ÏµÇ¾î ¸ðµç ¿ÀºêÁ§Æ®ÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
protected String |
paramString ()
ÀÌ Button »óŸ¦ ³ªÅ¸³»´Â ij¸¯ÅÍ ¶óÀÎÀ» µ¹·ÁÁÝ´Ï´Ù. |
protected void |
processActionEvent (ActionEvent e)
ÀÌ ¹öưÀ¸·Î ¹ß»ýÇÏ´Â ¾×¼Ç À̺¥Æ®¸¦, µî·ÏµÇ¾î ÀÖ´Â ActionListener ¿ÀºêÁ§Æ®¿¡ µð½ºÆÌÄ¡ ÇÏ´Â °ÍÀ¸·Î½á, ¾×¼Ç À̺¥Æ®¸¦ ó¸®ÇÕ´Ï´Ù.
|
protected void |
processEvent (AWTEvent e)
ÀÌ ¹öư¿¡ °üÇÑ À̺¥Æ®¸¦ ó¸®ÇÕ´Ï´Ù. |
void |
removeActionListener (ActionListener l)
ÀÌ ¹öưÀ¸·ÎºÎÅÍ ¾×¼Ç À̺¥Æ®¸¦ ¹ÞÁö ¾Ê°Ô, ÁöÁ¤µÈ ¾×¼Ç ûÃëÀÚ¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
setActionCommand (String command)
ÀÌ ¹öư¿¡ ÀÇÇØ ¹æ¾Æ¼è µÇ´Â ¾×¼Ç À̺¥Æ®ÀÇ Ä¿¸àµå¸íÀ» ¼³Á¤ÇÕ´Ï´Ù. |
void |
setLabel (String label)
¹öưÀÇ label¸¦, ÁöÁ¤µÈ ij¸¯ÅÍ ¶óÀÎÀ¸·Î ¼³Á¤ÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
»ý¼ºÀÚÀÇ »ó¼¼ |
public Button() throws HeadlessException
HeadlessException
- GraphicsEnvironment.isHeadless()°¡ true ¸¦ µ¹·ÁÁÖ´Â °æ¿ìGraphicsEnvironment.isHeadless()
public Button(String label) throws HeadlessException
label
- ¹öưÀÇ Ä³¸¯ÅÍ ¶óÀÎ label
HeadlessException
- GraphicsEnvironment.isHeadless()°¡ true ¸¦ µ¹·ÁÁÖ´Â °æ¿ìGraphicsEnvironment.isHeadless()
¸Þ¼ÒµåÀÇ »ó¼¼ |
public void addNotify()
Component
³»ÀÇ addNotify
Toolkit.createButton(java.awt.Button)
,
Component.getToolkit()
public String getLabel()
null
setLabel(java.lang.String)
public void setLabel(String label)
label
- »õ·Î¿î label. ¹öư¿¡ label°¡ ¾ø´Â °æ¿ì´Â null
getLabel()
public void setActionCommand(String command)
command
- ¹öưÀÇ ¾×¼Ç Ä¿¸àµå ¼³Á¤¿¡ »ç¿ëµÇ´Â ij¸¯ÅÍ ¶óÀÎ. ij¸¯ÅÍ ¶óÀÎÀÌ null
ÀÇ °æ¿ì, ¾×¼Ç Ä¿¸àµå´Â ¹öưÀÇ label¿Í ÀÏÄ¡Çϵµ·Ï(µíÀÌ) ¼³Á¤µÇ´ÂActionEvent
public String getActionCommand()
null
(µðÆúÆ®)ÀÇ °æ¿ì, ÀÌ ¸Þ¼Òµå´Â ¹öưÀÇ label¸¦ µ¹·ÁÁÝ´Ï´Ù.
public void addActionListener(ActionListener l)
l
- ¾×¼Ç ûÃëÀÚremoveActionListener(java.awt.event.ActionListener)
,
getActionListeners()
,
ActionListener
public void removeActionListener(ActionListener l)
l
- ¾×¼Ç ûÃëÀÚaddActionListener(java.awt.event.ActionListener)
,
getActionListeners()
,
ActionListener
public ActionListener [] getActionListeners()
ActionListener
. ¾×¼Ç ûÃëÀÚ°¡ ÇöÀç µî·ÏµÇÁö ¾ÊÀº °æ¿ì´Â ÇÏ´ÃÀÇ ¹è¿À» µ¹·ÁÁÖ´ÂaddActionListener(java.awt.event.ActionListener)
,
removeActionListener(java.awt.event.ActionListener)
,
ActionListener
public EventListener [] getListeners(Class listenerType)
Button
¿¡ FooListener
·Î¼ ÇöÀç µî·ÏµÇ¾î ¸ðµç ¿ÀºêÁ§Æ®ÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. ÀÌ FooListener
´Â addFooListener
¸Þ¼Òµå·Î µî·ÏµÈ °ÍÀÔ´Ï´Ù.
listenerType
Àμö´Â FooListener.class
¿Í °°Àº Ŭ·¡½º ¸®ÅÍ·²·Î ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î, ÀÌ ¾×¼Ç ûÃëÀÚ¿¡ ´ëÇÑ Button
b
ÀÇ Á¶È¸´Â ´ÙÀ½ÀÇ ÄÚµå·Î ½Ç½ÃÇÕ´Ï´Ù.
ActionListener[] als = (ActionListener[])(b.getListeners(ActionListener.class));ÀÌ·¯ÇÑ Ã»ÃëÀÚ°¡ ¾ø´Â °æ¿ì´Â ÇÏ´ÃÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù.
Component
³»ÀÇ getListeners
listenerType
- ¿ä±¸µÇ´Â ûÃëÀÚÀÇ Å¸ÀÔ. java.util.EventListener
ÀÇ ÇÏÀ§ ÀÎÅÍÆäÀ̽º¸¦ ÁöÁ¤
FooListener
·Î¼ µî·ÏµÇ¾î ¸ðµç ¿ÀºêÁ§Æ®ÀÇ ¹è¿. ûÃëÀÚ°¡ µî·ÏµÇÁö ¾ÊÀº °æ¿ì´Â ÇÏ´ÃÀÇ ¹è¿À» µ¹·ÁÁØ´Ù
ClassCastException
- if listenerType
°¡ java.util.EventListener
¸¦ ±¸ÇöÇϴ Ŭ·¡½º ¶Ç´Â ÀÎÅÍÆäÀ̽º¸¦ ÁöÁ¤ÇÏÁö ¾Ê´Â °æ¿ìgetActionListeners()
protected void processEvent(AWTEvent e)
ActionEvent
ÀÇ ÀνºÅϽºÀÎ °æ¿ì, ÀÌ ¸Þ¼Òµå´Â processActionEvent
¸Þ¼Òµå¸¦ È£ÃâÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀº °æ¿ì´Â ½´ÆÛ Ŭ·¡½ºÀÇ processEvent
¸¦ È£ÃâÇÕ´Ï´Ù.
À̺¥Æ® ÆÄ¶ó¹ÌÅͰ¡ null
ÀÇ °æ¿ìÀÇ µ¿ÀÛÀº Á¤ÀǵǾî ÀÖÁö ¾Ê±â ¶§¹®¿¡ ¿¹¿Ü°¡ ½½·Î¿ì µË´Ï´Ù.
Component
³»ÀÇ processEvent
e
- À̺¥Æ®ActionEvent
,
processActionEvent(java.awt.event.ActionEvent)
protected void processActionEvent(ActionEvent e)
ActionListener
¿ÀºêÁ§Æ®¿¡ µð½ºÆÌÄ¡ ÇÏ´Â °ÍÀ¸·Î½á, ¾×¼Ç À̺¥Æ®¸¦ ó¸®ÇÕ´Ï´Ù.
ÀÌ ¹öư¿¡ ´ëÇØ¼ ¾×¼Ç À̺¥Æ®°¡ »ç¿ë °¡´ÉÇÏÁö ¾ÊÀº °æ¿ì, ÀÌ ¸Þ¼Òµå´Â ºÒ·Á °¡Áö ¾Ê½À´Ï´Ù. ¾×¼Ç À̺¥Æ®´Â ´ÙÀ½ÀÇ ¾î¶² °ÍÀΰ¡ÀÇ °æ¿ì¿¡ »ç¿ë °¡´ÉÇÏ°Ô µË´Ï´Ù.
ActionListener
¿ÀºêÁ§Æ®°¡ addActionListener
¿¡ ÀÇÇØ µî·ÏµÇ¾î ÀÖ´Ù
enableEvents
¿¡ ÀÇÇØ ¾×¼Ç À̺¥Æ®°¡ »ç¿ë °¡´ÉÇÏ°Ô µÇ¾î ÀÖ´Ù
À̺¥Æ® ÆÄ¶ó¹ÌÅͰ¡ null
ÀÇ °æ¿ìÀÇ µ¿ÀÛÀº Á¤ÀǵǾî ÀÖÁö ¾Ê±â ¶§¹®¿¡ ¿¹¿Ü°¡ ½½·Î¿ì µË´Ï´Ù.
e
- ¾×¼Ç À̺¥Æ®ActionListener
,
addActionListener(java.awt.event.ActionListener)
,
Component.enableEvents(long)
protected String paramString()
Button
»óŸ¦ ³ªÅ¸³»´Â ij¸¯ÅÍ ¶óÀÎÀ» µ¹·ÁÁÝ´Ï´Ù. ÀÌ ¸Þ¼Òµå´Â µð¹ö±× Àü¿ëÀ̸ç, µ¹·ÁÁÖ¾îÁö´Â ij¸¯ÅÍ ¶óÀÎÀÇ ³»¿ë ¹× Çü½ÄÀº ±¸Çö¿¡ µû¶ó¼ ´Ù¸¨´Ï´Ù. µ¹·ÁÁÖ¾îÁö´Â ij¸¯ÅÍ ¶óÀÎÀº °ø¹éÀÇ °æ¿ì°¡ ÀÖ½À´Ï´Ù¸¸,null
·Î´Â µÇÁö ¾Ê½À´Ï´Ù.
Component
³»ÀÇ paramString
public AccessibleContext getAccessibleContext()
Button
¿¡ °ü·ÃÁöÀ» ¼ö ÀÖ´Â AccessibleContext
¸¦ ÃëµæÇÕ´Ï´Ù. AccessibleContext
´Â ¹öưÀÇ ÆûÀ» AccessibleAWTButton
·ÎºÎÅÍ ÃëµæÇÕ´Ï´Ù. ÇÊ¿äÇÑ °æ¿ì´Â »õ·Î¿î AccessibleAWTButton
ÀνºÅϽº¸¦ »ý¼ºÇÕ´Ï´Ù.
Accessible
³»ÀÇ getAccessibleContext
Component
³»ÀÇ getAccessibleContext
Button
ÀÇ AccessibleContext
·Î¼ ±â´ÉÇÏ´Â AccessibleAWTButton
|
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.