|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLayeredPane
public class JLayeredPane
JLayeredPane
´Â
JFC/Swing ÄÁÅ×À̳ʿ¡ ±íÀ̸¦ Ãß°¡ÇØ, ÇÊ¿äÇϸé ÄÄÆÛ³ÍÆ® ³¢¸®°¡ ¼·Î ¿À¹ö·¦ ÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù. Integer
°´Ã¼´Â ÄÁÅ×À̳ʳ»¿¡¼ÀÇ °¢ ÄÄÆÛ³ÍÆ®ÀÇ ±íÀ̸¦ ³ªÅ¸³», ¹øÈ£°¡ Å« ¸¸Å ´Ù¸¥ ÄÄÆÛ³ÍÆ® À§¿¡ Ç¥½ÃµË´Ï´Ù. °èÃþÈ ±¸È¹¿¡ °üÇÑ Å½ºÅ© ÁöÇâÀÇ ¹®¼ ¹× »ç¿ë¿¹´Â ¡¸The Java Tutorial¡¹ÀÇ ¡¸How to Use a Layered Pane¡¹¸¦ ÂüÁ¶ÇϽʽÿÀ.
|
JLayeredPane
´Â ±íÀÌÀÇ ¹üÀ§¸¦ ¸î°³ÀÇ ·¹À̾ ºÐÇÒÇϰí ÀÖ½À´Ï´Ù. ÄÄÆÛ³ÍÆ®¸¦ ÀÌ·¯ÇÑ ·¹À̾îÀÇ ¾î¶² °ÍÀΰ¡¿¡ ¹èÄ¡ÇÏ´Â °ÍÀ¸·Î ±íÀ̸¦ ÁöÁ¤ÇÏ´Â ¹øÈ£¸¦ ÁöÁ¤ÇÏ´Â °Í ¾øÀÌ,
ÄÄÆÛ³ÍÆ®¸¦ ÀûÀýÈ÷ ¿À¹ö·¦ ½Ãų ¼ö°¡ ÀÖ½À´Ï´Ù. JLayeredPane
¸Þ¼µåÀÎ moveToFront(Component)
, moveToBack(Component)
¹× setPosition
À»
»ç¿ëÇÏ´Â °ÍÀ¸·Î ·¹À̾¿¡¼ ÄÄÆÛ³ÍÆ®¸¦ Àç¹èÄ¡ÇÒ ¼ö ÀÖ½À´Ï´Ù
. setLayer
¸Þ¼µå¸¦ »ç¿ëÇϸé, ÄÄÆÛ³ÍÆ®ÀÇ ÇöÀçÀÇ ·¹À̾ º¯°æÇÒ ¼ö ÀÖ½À´Ï´Ù
.
JLayeredPane
´Â
Container
¿Í
°°ÀÌÀÚ½Ä
ÀÇ ¸®½ºÆ®¸¦ °ü¸®ÇÕ´Ï´Ù¸¸, ³»ºÎ¿¡¼ º¹¼öÀÇ ·¹À̾ Á¤ÀÇÇÒ ¼ö ÀÖ½À´Ï´Ù
. °°Àº ·¹À̾ ¼ÓÇÏ´ÂÀڽĴ º¸Åë
ÀÇ Container
°´Ã¼¿Í ¿ÏÀüÈ÷ ¶È°°ÀÌ °ü¸®µË´Ï´Ù¸¸,ÀÚ½Ä
ÄÄÆÛ³ÍÆ® ³¢¸®°¡ ¿À¹ö·¦ ÇßÀ» °æ¿ì¿¡´Â »óÀ§ÀÇ ·¹À̾îÀÇ ÄÄÆÛ³ÍÆ® ÂÊÀÌ ÇÏÀ§ ·¹À̾îÀÇ ÄÄÆÛ³ÍÆ®º¸´Ù À§¿¡ Ç¥½ÃµË´Ï´Ù.
°¢ ·¹À̾´Â °³º°ÀÇ Á¤¼ö°ªÀ» ÇÒ´çÇÒ ¼ö ÀÖ½À´Ï´Ù. Component
·¹ÀÌ¾î ¼Ó¼ºÀ» ¼³Á¤ÇÏ·Á¸é,
add È£Ãâ·Î Integer
°´Ã¼¸¦ °Ç³×ÁÝ´Ï´Ù.
ÀÌÇÏ¿¡ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù.
layeredPane.add(child, JLayeredPane.DEFAULT_LAYER); ¶Ç´Â layeredPane.add(child, new Integer(10));Component ·¹ÀÌ¾î ¼Ó¼ºÀ» ¼³Á¤ÇÏ·Á¸é, ÄÄÆÛ³ÍÆ®ÀÇ ºÎ¸ðÀÎ
JlayeredPane
»ó¿¡¼layeredPaneParent.setLayer(child, 10)¸¦ È£ÃâÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ·¹À̾î´Â ÀÚ½ÄÀ» ºÎ¸ð¿¡°Ô Ãß°¡Çϱâ ÀüÀ¸·Î ¼³Á¤ÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
¹øÈ£°¡ Å« ·¹À̾î(Á¤µµ)¸¸Å À§¿¡ Ç¥½ÃµË´Ï´Ù. µû¶ó¼, ´ÙÀ½°ú °°ÀÌ °¢ ÄÄÆÛ³ÍÆ®¿¡ °³º°ÀÇ ·¹ÀÌ¾î ¹øÈ£¿Í ¹®ÀÚ¸¦ ÇÒ´çÇÏ´Â °ÍÀ¸·Î
5a, 5b, 5c, 2a, 2b, 2c, 1a¿ÞÂÊÀÇ ÄÄÆÛ³ÍÆ®(Á¤µµ)¸¸Å À§¿¡ Ç¥½ÃµË´Ï´Ù.
ÄÄÆÛ³ÍÆ®¸¦ ·¹À̾¿¡¼ ¸Ç À§ ¶Ç´Â ¸Ç ¹Ø¿¡ À̵¿½ÃŰ·Á¸é,
moveToFront
¶Ç´Â moveToBack
¸¦ È£ÃâÇÕ´Ï´Ù.
·¹À̾¿¡¼ÀÇ ÄÄÆÛ³ÍÆ®ÀÇ À§Ä¡¸¦ À§Ä¡ ¹øÈ£·Î ÁöÁ¤ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ÁöÁ¤ÇÒ ¼ö ÀÖ´Â À§Ä¡ ¹øÈ£´Â 0 ~ ¡¸·¹À̾ÀÇ ÄÄÆÛ³ÍÆ®¼ö - 1¡¹ÀÔ´Ï´Ù. -1¸¦ ÁöÁ¤Çϸé, ÄÄÆÛ³ÍÆ®´Â ¸Ç ¹Ø¿¡ Ç¥½ÃµË´Ï´Ù. 0À» ÁöÁ¤Çϸé, ÄÄÆÛ³ÍÆ®´Â ¸Ç À§¿¡ Ç¥½ÃµË´Ï´Ù. ·¹ÀÌ¾î ¹øÈ£¿Í´Â ´Þ¶ó, °ªÀÌ Å« ¸¸Å ¾Æ·¡¿¡ Ç¥½ÃµË´Ï´Ù.
ÁÖ: ÀÌ ¼ø¼ (java.awt.Container ·Î Á¤Àǵǰí ÀÖ´Ù)´Â ·¹ÀÌ¾î ¹øÈ£ÀÇ ¼ø¼ÀÇ ¹Ý´ë·Î µÇ¾î ÀÖ½À´Ï´Ù. ÀϹÝÀûÀ¸·Îadd(Component, layer, position) ¸Þ¼µåÀÇ »ç¿ë¿¹¸¦ ³ªÅ¸³À´Ï´Ù. add(5x, 5, -1) È£ÃâÀÇ °á°ú´Â ´ÙÀ½°ú °°½À´Ï´Ù.moveToFront
,moveToBack
¹×setLayer
¸¦ »ç¿ëÇÕ´Ï´Ù.
5a, 5b, 5c, 5x, 2a, 2b, 2c, 1aadd(5z, 5, 2) È£ÃâÀÇ °á°ú´Â ´ÙÀ½°ú °°½À´Ï´Ù.
5a, 5b, 5z, 5c, 5x, 2a, 2b, 2c, 1aadd(3a, 3, 7) È£ÃâÀÇ °á°ú´Â ´ÙÀ½°ú °°½À´Ï´Ù.
5a, 5b, 5z, 5c, 5x, 3a, 2a, 2b, 2c, 1aº¸Åë ÀÇ ÆäÀÎÆ®/À̺¥Æ® ¹æ½ÄÀ¸·Î´Â 1a°¡ ¸Ç ¹Ø, 5a°¡ ¸Ç À§¿¡ Ç¥½ÃµË´Ï´Ù.
ÁÖ: ÀÌ·¯ÇÑ ·¹À̾î´Â ´ÜÁö ³í¸®ÀûÀÎ ±¸Á¶À̸ç, LayoutManager´Â ·¹ÀÌ¾î ¼³Á¤¿¡´Â °ü°è¾øÀÌ, ÀÌ ÄÁÅ×À̳ÊÀÇ ¸ðµçÀÚ½Ä ÄÄÆÛ³ÍÆ®¿¡ ¿µÇâÀ» ÁÝ´Ï´Ù.
°æ°í: ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ °´Ã¼´Â ÇâÈÄÀÇ Swing ¸±¸®Áî¿Í
ȣȯµÇÁö ¾ÊÀ» ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈÀÇ Áö¿øÀº
´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÀüÀÇ Swing¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. JDK ¹öÀü
1.4 ÀÌÈÄ, ¸ðµç JavaBeans™
Àå±â°£ÀÇ ¿î¿ë Áö¿øÀº
java.beans
ÆÐŰÁö¿¡ Ãß°¡µÇ°í ÀÖ½À´Ï´Ù. ÀÚ¼¼ÇÑ ³»¿ëÀº XMLEncoder
¸¦
ÂüÁ¶ÇϽʽÿÀ.
Áßø(Nested) Ŭ·¡½º °³¿ä | |
---|---|
protected class |
JLayeredPane.AccessibleJLayeredPane
ÀÌ Å¬·¡½º´Â JLayeredPane Ŭ·¡½º¿ëÀÇ »ç¿ëÀÚ
º¸Á¶ ±â´ÉÀÇ Áö¿ø¸¦ ±¸ÇöÇϰí ÀÖ½À´Ï´Ù. |
Ŭ·¡½º javax.swing. JComponent ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
JComponent.AccessibleJComponent |
Ŭ·¡½º java.awt. Container ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
Container.AccessibleAWTContainer |
Ŭ·¡½º java.awt. Component ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
Component.AccessibleAWTComponent,
Component.BltBufferStrategy,
Component.FlipBufferStrategy |
ÇÊµå °³¿ä | |
---|---|
static Integer |
DEFAULT_LAYER
µðÆúÆ® ·¹À̾ Á¤ÀÇÇÏ´Â °£ÀÌ °´Ã¼ÀÔ´Ï´Ù. |
static Integer |
DRAG_LAYER
µå·¡±× ·¹À̾ Á¤ÀÇÇÏ´Â °£ÀÌ °´Ã¼ÀÔ´Ï´Ù. |
static Integer |
FRAME_CONTENT_LAYER
ÇÁ·¹ÀÓ ³»¿ë ·¹À̾ Á¤ÀÇÇÏ´Â °£ÀÌ °´Ã¼ÀÔ´Ï´Ù. |
static String |
LAYER_PROPERTY
¹Ù¿îµå ÇÁ·ÎÆÛƼÀÔ´Ï´Ù. |
static Integer |
MODAL_LAYER
¸ð´ú ·¹À̾ Á¤ÀÇÇÏ´Â °£ÀÌ °´Ã¼ÀÔ´Ï´Ù. |
static Integer |
PALETTE_LAYER
ÆÈ·¹Æ® ·¹À̾ Á¤ÀÇÇÏ´Â °£ÀÌ °´Ã¼ÀÔ´Ï´Ù. |
static Integer |
POPUP_LAYER
pop-up ·¹À̾ Á¤ÀÇÇÏ´Â °£ÀÌ °´Ã¼ÀÔ´Ï´Ù. |
Ŭ·¡½º 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 |
»ý¼ºÀÚ °³¿ä | |
---|---|
JLayeredPane ()
»õ·Î¿î JLayeredPane¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
protected void |
addImpl (Component comp,
Object constraints,
int index)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦, ÁöÁ¤µÈ À妽º·Î ÄÁÅ×À̳ʿ¡ Ãß°¡ÇÕ´Ï´Ù. |
AccessibleContext |
getAccessibleContext ()
ÀÌ JLayeredPane¿¡ °ü·ÃÇÑ AccessibleContext¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getComponentCountInLayer (int layer)
ÁöÁ¤µÈ ·¹À̾îÀÇ ÇöÀçÀÇÀÚ½Ä ÀÇ ¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
Component [] |
getComponentsInLayer (int layer)
ÁöÁ¤µÈ ·¹À̾îÀÇ ÄÄÆÛ³ÍÆ®ÀÇ ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
protected Hashtable <Component,
Integer > |
getComponentToLayer ()
ÄÄÆÛ³ÍÆ®¸¦ ·¹À̾ ¸ÅÇÎ ÇÏ´Â ÇØ½Ã Å×À̺íÀ» ¸®ÅÏÇÕ´Ï´Ù. |
int |
getIndexOf (Component c)
ÁöÁ¤µÈ Component À妽º¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getLayer (Component c)
ÁöÁ¤µÈ Component ·¹ÀÌ¾î ¼Ó¼ºÀ» ¸®ÅÏÇÕ´Ï´Ù. |
static int |
getLayer (JComponent c)
JComponent ·¹À̾î ÇÁ·ÎÆÛƼ¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
static JLayeredPane |
getLayeredPaneAbove (Component c)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ Æ÷ÇÔÇÑ ÃÖÃÊÀÇ JLayeredPane¸¦ µ¹·ÁÁÖ´Â °£ÀÌ ¸Þ¼µåÀÔ´Ï´Ù. |
protected Integer |
getObjectForLayer (int layer)
ÁöÁ¤µÈ ·¹À̾ °ü·ÃÇÑ Integer °´Ã¼¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
getPosition (Component c)
·¹À̾¿¡¼ÀÇ ÄÄÆÛ³ÍÆ®ÀÇ »ó´ë À§Ä¡¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
highestLayer ()
ÇöÀçÀÇ ¸ðµçÀÚ½Ä ·ÎºÎÅÍ ÃÖ´ë ·¹À̾îÄ¡¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
protected int |
insertIndexForLayer (int layer,
int position)
·¹ÀÌ¾î ¹× À§Ä¡ÀÇ ¿ä±¸¿¡ µû¶ó »õ·Î¿î ÀÚ½ÄÀ» »ðÀÔÇÏ´Â ÀûÀýÇÑ À§Ä¡¸¦ °áÁ¤Çϱâ À§ÇÑ ¿ø½ÃÀû ¸Þ¼µåÀÔ´Ï´Ù. |
boolean |
isOptimizedDrawingEnabled ()
±¸È¹³»ÀÇ ÄÄÆÛ³ÍÆ®°¡ ¿À¹ö·¦ °¡´ÉÇÑ °æ¿ì¿¡´Â false¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
lowestLayer ()
ÇöÀçÀÇ ¸ðµçÀÚ½Ä ·ÎºÎÅÍ ÃÖ¼Ò ·¹À̾îÄ¡¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
void |
moveToBack (Component c)
ÄÄÆÛ³ÍÆ®¸¦ ÇöÀçÀÇ ·¹À̾î·Î ¸Ç ¹Ø (À§Ä¡ -1)À¸·Î À̵¿ÇÕ´Ï´Ù. |
void |
moveToFront (Component c)
ÄÄÆÛ³ÍÆ®¸¦ ÇöÀçÀÇ ·¹À̾î·Î ¸Ç À§ (À§Ä¡ 0)·Î À̵¿ÇÕ´Ï´Ù. |
void |
paint (Graphics g)
ÁöÁ¤µÈ ±×·¡ÇÈ ÄÁÅØ½ºÆ® À¸·Î ÀÌ JLayeredPane¸¦ ·»´õ¸µ ÇÕ´Ï´Ù. |
protected String |
paramString ()
ÀÌ JLayeredPane ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. |
static void |
putLayer (JComponent c,
int layer)
JComponent ·¹À̾î ÇÁ·ÎÆÛƼ¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
remove (int index)
ÀÌ ±¸È¹À¸·ÎºÎÅÍ À妽º ÷ºÎÀÇ ÄÄÆÛ³ÍÆ®¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeAll ()
ÄÁÅ×À̳ʷκÎÅÍ ¸ðµç ÄÄÆÛ³ÍÆ®¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
setLayer (Component c,
int layer)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ·¹ÀÌ¾î ¼Ó¼ºÀ» ¼³Á¤ÇØ, ·¹À̾¿¡¼ ¸Ç ¹ØÀÇ ÄÄÆÛ³ÍÆ®·Î ÇÕ´Ï´Ù. |
void |
setLayer (Component c,
int layer,
int position)
ÁöÁ¤µÈ ÄÄÆÛ³ÍÆ®ÀÇ ·¹ÀÌ¾î ¼Ó¼º°ú ·¹À̾¿¡¼ÀÇ ÄÄÆÛ³ÍÆ®ÀÇ À§Ä¡¸¦ ÁöÁ¤ÇÕ´Ï´Ù. |
void |
setPosition (Component c,
int position)
ÄÄÆÛ³ÍÆ®¸¦ ÇöÀçÀÇ ·¹À̾îÀÇ position ·Î
À̵¿ÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
ÇʵåÀÇ »ó¼¼ |
---|
public static final Integer DEFAULT_LAYER
public static final Integer PALETTE_LAYER
public static final Integer MODAL_LAYER
public static final Integer POPUP_LAYER
public static final Integer DRAG_LAYER
public static final Integer FRAME_CONTENT_LAYER
JFrame
public static final String LAYER_PROPERTY
»ý¼ºÀÚ »ó¼¼ |
---|
public JLayeredPane()
¸Þ¼µåÀÇ »ó¼¼ |
---|
protected void addImpl(Component comp, Object constraints, int index)
Container
񃬣: addLayoutComponent
¸Þ¼µå¸¦ »ç¿ëÇØ, ÁöÁ¤µÈ Á¦¾à °´Ã¼¸¦ »ç¿ëÇØ ÀÌ ÄÁÅ×À̳ÊÀÇ ·¹À̾ƿô¿¡ ÄÄÆÛ³ÍÆ®¸¦ Ãß°¡ÇÏ´Â °ÍÀ» ·¹À̾ƿô ¸Å´ÏÀú¿¡ ÅëÁöÇÕ´Ï´Ù.
Á¦¾àÀº »ç¿ëµÇ°í ÀÖ´Â ·¹À̾ƿô ¸Å´ÏÀú¸¦ »ç¿ëÇØ Á¤Àǵ˴ϴÙ. ¿¹¸¦ µé¾î BorderLayout
Ŭ·¡½º´Â BorderLayout.NORTH
, BorderLayout.SOUTH
, BorderLayout.EAST
, BorderLayout.WEST
¹× BorderLayout.CENTER
5°³ÀÇ Á¦¾àÀ» Á¤ÀÇÇÕ´Ï´Ù.
GridBagLayout
Ŭ·¡½º¿¡´Â GridBagConstraints
°´Ã¼°¡ ÇÊ¿äÇÕ´Ï´Ù. ¿Ã¹Ù¸¥ ÇüÅÂÀÇ Á¦¾à °´Ã¼¸¦ °Ç³×ÁÖÁö ¾ÊÀ¸¸éIllegalArgumentException
°¡ ¹ß»ýÇÕ´Ï´Ù.
·¹À̾ƿô ¸Å´ÏÀú°¡ LayoutManager
ÀÎÅÍÆäÀ̽º¿Í LayoutManager2
ÀÎÅÍÆäÀ̽ºÀÇ ¾çÂÊ ¸ðµÎ¸¦ ±¸ÇöÇÏ´Â °æ¿ì, LayoutManager2
¸Þ¼µå¸¦ È£ÃâÇÕ´Ï´Ù.
ÄÄÆÛ³ÍÆ®°¡ ÀÌ ÄÁÅ×À̳Ê, ¶Ç´Â ±×ÀڽĿ¡ °Ô µî·ÏÁ¦ÀÇ °æ¿ì, ÀÌ ÄÁÅ×À̳ʿ¡ Ãß°¡Çϱâ Àü¿¡ »èÁ¦µË´Ï´Ù.
À̰ÍÀº ÇÁ·Î±×·¥ÀÌ ÄÁÅ×À̳ʿ¡ÀÇ ¸ðµç Ãß°¡ ¿ä±¸¸¦ ÃßÀûÇÒ Çʿ䰡 ÀÖ´Â °æ¿ì¿¡ ¿À¹ö¶óÀ̵å(override) ÇÏ´Â ¸Þ¼µåÀÔ´Ï´Ù. ´Ù¸¥ ¸ðµç Ãß°¡ ¸Þ¼µå¿¡¼´Â ÃßÀûÀ» ½Ç½ÃÇÏÁö ¾Ê½À´Ï´Ù. ¿À¹ö¶óÀ̵å(override) ÇÏ´Â ¸Þ¼µå´Â º¸Åë, ¸Þ¼µåÀÇ ½´ÆÛ Ŭ·¡½ºÀÇ ¹öÀüÀÇ È£ÃâÀ» Æ÷ÇÔÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
super.addImpl(comp, constraints, index)
Container
³»ÀÇ addImpl
comp
- Ãß°¡µÇ´Â ÄÄÆÛ³ÍÆ®constraints
- ÀÌ ÄÄÆÛ³ÍÆ®ÀÇ ¹èÄ¡ Á¦¾àÀ» Ç¥ÇöÇÏ´Â °´Ã¼index
- ÄÄÆÛ³ÍÆ®¸¦ »ðÀÔÇÏ´Â ÄÁÅ×À̳ÊÀÇ ¸®½ºÆ®³»¿¡¼ÀÇ À§Ä¡. -1
´Â ¸¶Áö¸·¿¡ »ðÀÔÇÏ´Â °ÍÀ»ÀǹÌÇÏ´ÂContainer.add(Component)
,
Container.add(Component, int)
,
Container.add(Component, java.lang.Object)
,
LayoutManager
,
LayoutManager2
public void remove(int index)
Container
³»ÀÇ remove
index
- »èÁ¦ÇÏ´Â ÄÄÆÛ³ÍÆ®¸¦ ÁöÁ¤ÇÑ int°ª
getIndexOf(java.awt.Component)
public void removeAll()
Container
³»ÀÇ removeAll
Container.add(java.awt.Component)
,
Container.remove(int)
public boolean isOptimizedDrawingEnabled()
JComponent
³»ÀÇ isOptimizedDrawingEnabled
JComponent.isOptimizedDrawingEnabled()
public static void putLayer(JComponent c, int layer)
c
- À̵¿ÇÏ´Â JComponentlayer
- À̵¿Ã³ÀÇ ·¹À̾ ÁöÁ¤ÇÏ´Â int°ª
setLayer(java.awt.Component, int)
public static int getLayer(JComponent c)
c
- üũ ´ë»óÀÇ JComponent
public static JLayeredPane getLayeredPaneAbove(Component c)
c
- üũ ´ë»óÀÇ Component
JFrame
,
JRootPane
public void setLayer(Component c, int layer)
c
- ·¹À̾ ¼³Á¤ÇÏ´Â Componentlayer
- ¼³Á¤ÇÏ´Â ·¹À̾ ÁöÁ¤ÇÏ´Â int°ª
. °ªÀÌ ÀÛÀ» Á¤µµ ÇÏÃþpublic void setLayer(Component c, int layer, int position)
c
- ·¹À̾ ¼³Á¤ÇÏ´Â Componentlayer
- ¼³Á¤ÇÏ´Â ·¹À̾ ÁöÁ¤ÇÏ´Â int°ª
. °ªÀÌ ÀÛÀ» Á¤µµ ÇÏÃþposition
- ·¹À̾¿¡¼ÀÇ À§Ä¡¸¦ ÁöÁ¤ÇÏ´Â int°ª
. 0 ÀÌ ¸Ç À§,-1°¡ ¸Ç ¹Øpublic int getLayer(Component c)
c
- üũ ´ë»óÀÇ Component
public int getIndexOf(Component c)
c
- üũ ´ë»óÀÇ Component
public void moveToFront(Component c)
c
- À̵¿ÇÏ´Â ComponentsetPosition(Component, int)
public void moveToBack(Component c)
c
- À̵¿ÇÏ´Â ComponentsetPosition(Component, int)
public void setPosition(Component c, int position)
position
·Î
À̵¿ÇÕ´Ï´Ù. 0 ÀÌ ¸Ç À§,-1°¡ ¸Ç ¹ØÀÔ´Ï´Ù.
ÁÖ: À§Ä¡ ¹øÈ£´Â java.awt.Container¿¡ ÀÇÇØ Á¤Àǵǰí ÀÖ¾î ·¹ÀÌ¾î ¹øÈ£ÀÇ ¼ø¼ÀÇ ¹Ý´ë·Î µÇ¾î ÀÖ½À´Ï´Ù. À§Ä¡ ¹øÈ£°¡ ÀÛÀ» Á¤µµ À§ (0 ÀÌ ¸Ç À§), Å« ¸¸Å ¾Æ·¡°¡ µË´Ï´Ù.
c
- À̵¿ÇÏ´Â Componentposition
- -1 ~ N-1 (N´Â ÇöÀçÀÇ ·¹À̾îÀÇ ÄÄÆÛ³ÍÆ®¼ö)ÀÇ ¹üÀ§³»ÀÇ int°ª
public int getPosition(Component c)
c
- üũ ´ë»óÀÇ Component
getComponentCountInLayer(int)
public int highestLayer()
public int lowestLayer()
public int getComponentCountInLayer(int layer)
layer
- üũÇÏ´Â ·¹À̾ ÁöÁ¤ÇÏ´Â int°ª
public Component [] getComponentsInLayer(int layer)
layer
- üũÇÏ´Â ·¹À̾ ÁöÁ¤ÇÏ´Â int°ª
public void paint(Graphics g)
JComponent
³»ÀÇ paint
g
- ÆäÀÎÆ®Ã³°¡ µÇ´Â Graphics ÄÁÅØ½ºÆ®
JComponent.paintComponent(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintChildren(java.awt.Graphics)
,
JComponent.getComponentGraphics(java.awt.Graphics)
,
JComponent.repaint(long, int, int, int, int)
protected Hashtable <Component, Integer > getComponentToLayer()
protected Integer getObjectForLayer(int layer)
layer
- ·¹À̾ ÁöÁ¤ÇÏ´Â int°ª
protected int insertIndexForLayer(int layer, int position)
layer
- ·¹À̾ ÁöÁ¤ÇÏ´Â int°ª
position
- ·¹À̾ÀÇ À§Ä¡¸¦ ÁöÁ¤ÇÏ´Â int°ª
getIndexOf(java.awt.Component)
protected String paramString()
null
·Î´Â µÇÁö ¾Ê½À´Ï´Ù.
JComponent
³»ÀÇ paramString
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 µµ ÂüÁ¶ÇϽʽÿÀ.