|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.Box
public class Box
BoxLayout °´Ã¼¸¦ ·¹À̾ƿô ¸Å´ÏÀú·Î¼ »ç¿ëÇÏ´Â °æ·®ÀÎ ÄÁÅ×À̳ÊÀÔ´Ï´Ù. Box ¿¡´Â BoxLayout¸¦ »ç¿ëÇÏ´Â ÄÁÅ×ÀÌ³Ê ¶Ç´Â Box°¡ ¾Æ´Ñ ÄÁÅ×À̳ʿ¡µµ Æí¸®ÇÑ Å¬·¡½º ¸Þ¼µå°¡ ¸î°³Àΰ¡ ÁغñµÇ¾î ÀÖ½À´Ï´Ù.
Box
Ŭ·¡½º´Â ·¹À̾ƿô¿¡ ¿µÇâÀ» ÁÖ´Â ¿©·¯Á¾·ùÀÇ ºÒ°¡½Ã ÄÄÆÛ³ÍÆ®¸¦ ÀÛ¼ºÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î
Á¢ÂøÁ¦ (glue), ±âµÕ (strut) ¹× °íÁ¤ ¿µ¿ª (rigid area)ÀÔ´Ï´Ù. Box
¿¡ Æ÷ÇԵǴ ¸ðµç ÄÄÆÛ³ÍÆ®ÀÇ »çÀÌÁî°¡ °íÁ¤µÇ°í ÀÖ´Â °æ¿ì´Â createGlue
°¡ µ¹·ÁÁÖ´Â Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®¸¦ »ç¿ëÇØ, ÄÄÆÛ³ÍÆ®ÀÇ À§Ä¡¸¦ Á¦¾îÇÒ ¼ö ÀÖ½À´Ï´Ù. 2°³ÀÇ ÄÄÆÛ³ÍÆ®ÀÇ »çÀÌ¿¡ ÀÏÁ¤ÇÑ °ø°£ÀÌ ÇÊ¿äÇÑ °æ¿ì´Â ±âµÕÀ» »ç¿ëÇØ º¸´Â °ÍÀ» ÃßõÇÕ´Ï´Ù (createHorizontalStrut
¶Ç´Â createVerticalStrut
). Ç×»ó °°Àº ¾çÀÇ °ø°£À» Â÷ÁöÇÏ´Â ºÒ°¡½Ã ÄÄÆÛ³ÍÆ®°¡ ÇÊ¿äÇÑ °æ¿ì´Â createRigidArea
¸¦ È£ÃâÇÏ´Â °ÍÀ¸·Î ±× ÄÄÆÛ³ÍÆ®¸¦ ÃëµæÇÕ´Ï´Ù.
BoxLayout
¸¦ ±¸ÇöÇϰí ÀÖ´Â °æ¿ì, »ó¼¼ÇÑ Á¤º¸¿Í ¿¹¿¡ ´ëÇØ¼´Â ¡¸The Java Tutorial¡¹ÀÇ ¡¸How to Use BoxLayout¡¹¸¦ ÂüÁ¶ÇϽʽÿÀ.
°æ°í: ÀÌ Å¬·¡½ºÀÇ Á÷·ÄÈ µÈ °´Ã¼´Â ÇâÈÄÀÇ Swing ¸±¸®Áî¿Í
ȣȯµÇÁö ¾ÊÀ» ¿¹Á¤ÀÔ´Ï´Ù. ÇöÀçÀÇ Á÷·ÄÈÀÇ Áö¿øÀº
´Ü±â°£ÀÇ ¿î¿ëÀ̳ª, °°Àº ¹öÀüÀÇ Swing¸¦ ½ÇÇàÇÏ´Â ¾îÇø®ÄÉÀ̼ǰ£ÀÇ RMI¿¡ ÀûÀýÇϰí ÀÖ½À´Ï´Ù. JDK ¹öÀü
1.4 ±× µÚ·Î´Â java.beans
ÆÐŰÁö·Î ¸ðµç JavaBeans™
Àå±â ±â¾ïÀÌ Áö¿ø
µË´Ï´Ù. XMLEncoder
¸¦
ÂüÁ¶ÇϽʽÿÀ.
BoxLayout
Áßø(Nested) Ŭ·¡½º °³¿ä | |
---|---|
protected class |
Box.AccessibleBox
ÀÌ Å¬·¡½º´Â Box Ŭ·¡½º¿ëÀÇ »ç¿ëÀÚ
º¸Á¶ ±â´ÉÀÇ Áö¿ø¸¦ ±¸ÇöÇϰí ÀÖ½À´Ï´Ù. |
static class |
Box.Filler
·¹À̾ƿô¿¡ °ü·ÃÇØ, ºä¸¦ °¡ÁöÁö ¾Ê´Â °æ·® ÄÄÆÛ³ÍÆ®ÀÇ ±¸ÇöÀÔ´Ï´Ù. |
Ŭ·¡½º javax.swing. JComponent ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
JComponent.AccessibleJComponent |
Ŭ·¡½º java.awt. Container ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
Container.AccessibleAWTContainer |
Ŭ·¡½º java.awt. Component ·ÎºÎÅÍ »ó¼ÓµÈ Áßø(Nested) Ŭ·¡½º/ÀÎÅÍÆäÀ̽º |
---|
Component.AccessibleAWTComponent,
Component.BltBufferStrategy,
Component.FlipBufferStrategy |
ÇÊµå °³¿ä | |
---|---|
protected AccessibleContext |
accessibleContext
ÇöÀç ¼³Á¤µÇ¾î ÀÖ´Â AccessibleContext °´Ã¼ÀÔ´Ï´Ù. |
Ŭ·¡½º javax.swing. JComponent ·ÎºÎÅÍ »ó¼ÓµÈ Çʵå |
---|
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 |
»ý¼ºÀÚ °³¿ä | |
---|---|
Box (int axis)
ÁöÁ¤µÈ ÃàÀ¸·Î µû¶ó ÄÄÆÛ³ÍÆ®¸¦ ´Ã¾î³õ´Â Box ¸¦ »ý¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
static Component |
createGlue ()
ºÒ°¡½ÃÀÇ Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
static Box |
createHorizontalBox ()
ÄÄÆÛ³ÍÆ®¸¦ ¿ÞÂÊ¿¡¼ ¿À¸¥ÂÊ¿¡ ´Ã¾î³õ´Â Box ¸¦ »ý¼ºÇÕ´Ï´Ù. |
static Component |
createHorizontalGlue ()
¼öÆò ¹æÇâÀÇ Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
static Component |
createHorizontalStrut (int width)
ºÒ°¡½ÃÀÇ °íÁ¤ÆøÄÄÆÛ³ÍÆ®¸¦ »ý¼ºÇÕ´Ï´Ù. |
static Component |
createRigidArea (Dimension d)
Ç×»ó ÁöÁ¤µÈ »çÀÌÁîÀÎ ºÒ°¡½Ã ÄÄÆÛ³ÍÆ®¸¦ »ý¼ºÇÕ´Ï´Ù. |
static Box |
createVerticalBox ()
ÄÄÆÛ³ÍÆ®¸¦ À§¿¡¼ ¹ØÀ¸·Î ´Ã¾î³õ´Â Box ¸¦ »ý¼ºÇÕ´Ï´Ù. |
static Component |
createVerticalGlue ()
¼öÁ÷ ¹æÇâÀÇ Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
static Component |
createVerticalStrut (int height)
ºÒ°¡½ÃÀÇ, ³ôÀ̰¡ °íÁ¤µÈ ÄÄÆÛ³ÍÆ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
AccessibleContext |
getAccessibleContext ()
ÀÌ ¹Ú½º¿¡ °ü·ÃÇÑ AccessibleContext¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
void |
setLayout (LayoutManager l)
AWTError¸¦ Throw ÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
ÇʵåÀÇ »ó¼¼ |
---|
protected AccessibleContext accessibleContext
»ý¼ºÀÚ »ó¼¼ |
---|
public Box(int axis)
Box
¸¦ »ý¼ºÇÕ´Ï´Ù.
axis
- BoxLayout.X_AXIS
,
BoxLayout.Y_AXIS
,
BoxLayout.LINE_AXIS
,
¶Ç´Â BoxLayout.PAGE_AXIS
AWTError
- axis
°¡ ¹«È¿ÀÎ °æ¿ìcreateHorizontalBox()
,
createVerticalBox()
¸Þ¼µåÀÇ »ó¼¼ |
---|
public static Box createHorizontalBox()
Box
¸¦ »ý¼ºÇÕ´Ï´Ù. ÄÄÆÛ³ÍÆ®ÀÇ ¹æÇâÀ» °í·ÁÇÑ Box
°¡ ÇÊ¿äÇÑ °æ¿ì´Â »ý¼ºÀÚ¸¦ »ç¿ëÇØ Box
¸¦ »ý¼ºÇØ, BoxLayout.LINE_AXIS
¿¡ °Ç³×ÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. ´ÙÀ½¿¡ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù.
Box lineBox = new Box(BoxLayout.LINE_AXIS);
public static Box createVerticalBox()
Box
¸¦ »ý¼ºÇÕ´Ï´Ù. ÄÄÆÛ³ÍÆ®ÀÇ ¹æÇâÀ» °í·ÁÇÑ Box
°¡ ÇÊ¿äÇÑ °æ¿ì´Â »ý¼ºÀÚ¸¦ »ç¿ëÇØ Box
¸¦ »ý¼ºÇØ, BoxLayout.PAGE_AXIS
¿¡ °Ç³×ÁÙ Çʿ䰡 ÀÖ½À´Ï´Ù. ´ÙÀ½¿¡ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù.
Box lineBox = new Box(BoxLayout.PAGE_AXIS);
public static Component createRigidArea(Dimension d)
d
- ºÒ°¡½Ã ÄÄÆÛ³ÍÆ®ÀÇ »çÀÌÁî
createGlue()
,
createHorizontalStrut(int)
,
createVerticalStrut(int)
public static Component createHorizontalStrut(int width)
width
- ºÒ°¡½Ã ÄÄÆÛ³ÍÆ®ÀÇ Çȼ¿ ´ÜÀ§ÀÇ Æø. °ªÀº Á¦·Î ÀÌ»ó
createVerticalStrut(int)
,
createGlue()
,
createRigidArea(java.awt.Dimension)
public static Component createVerticalStrut(int height)
height
- ºÒ°¡½Ã ÄÄÆÛ³ÍÆ®ÀÇ Çȼ¿ ´ÜÀ§ÀÇ ³ôÀÌ. °ªÀº Á¦·Î ÀÌ»ó
createHorizontalStrut(int)
,
createGlue()
,
createRigidArea(java.awt.Dimension)
public static Component createGlue()
¿¹¸¦ µé¾î 1°³ÀÇ ¼öÆò ¹Ú½º¿¡ °íÁ¤ »çÀÌÁîÀÇ ÄÄÆÛ³ÍÆ®°¡ 2°³ Æ÷ÇԵǾî ÀÖ´Ù°í ÇÕ´Ï´Ù. ÀÌ ¹Ú½º¿¡ °ø°£ÀÌ Ãß°¡µÇ¾îµµ, °íÁ¤ »çÀÌÁî ÄÄÆÛ³ÍÆ®´Â Ä¿ÁöÁö ¾Ê½À´Ï´Ù. ÀÌ ¶§, Á¢ÂøÁ¦°¡ ¾ø´Â °æ¿ì, 2¹øÂ°ÀÇ ÄÄÆÛ³ÍÆ®ÀÇ ¿À¸¥ÂÊÀÇ °ø°£ÀÌ ³²½À´Ï´Ù. ¿©±â¼ Á¢ÂøÁ¦¸¦ °íÁ¤ »çÀÌÁî ÄÄÆÛ³ÍÆ®ÀÇ »çÀÌ¿¡ µÎ¸é, ³²Àº °ø°£À» Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®°¡ Â÷ÁöÇÕ´Ï´Ù. Á¢ÂøÁ¦¸¦ 1¹øÂ°ÀÇ °íÁ¤ »çÀÌÁî ÄÄÆÛ³ÍÆ®ÀÇ Àü¿¡ µÎ¸é, ³²Àº °ø°£À» Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®°¡ Â÷ÁöÇØ 2°³ÀÇ °íÁ¤ »çÀÌÁî ÄÄÆÛ³ÍÆ®´Â ¹Ú½ºÀÇ ¿À¸¥ÂÊÀ¸·Î ÀüÇØÁý´Ï´Ù. 1¹øÂ°ÀÇ °íÁ¤ »çÀÌÁî ÄÄÆÛ³ÍÆ®ÀÇ Àü ¹× 2¹øÂ°ÀÇ °íÁ¤ »çÀÌÁî ÄÄÆÛ³ÍÆ®ÀÇ ÈÄ¿¡ Á¢ÂøÁ¦¸¦ µÎ¸é, 2°³ÀÇ °íÁ¤ »çÀÌÁî ÄÄÆÛ³ÍÆ®´Â ¹Ú½ºÀÇ Áß¾Ó¿¡ ÀüÇØÁý´Ï´Ù.
Á¢ÂøÁ¦¸¦ »ç¿ëÇÏ·Á¸é,
Box.createGlue
¸¦ È£ÃâÇØ, ¸®ÅÏµÈ ÄÄÆÛ³ÍÆ®¸¦ ÄÁÅ×À̳ʿ¡ Ãß°¡ÇÕ´Ï´Ù. Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®¿¡´Â ÃÖ¼ÒÀÇ »çÀÌÁî, ȤÀº ÀûÀýÇÑ »çÀÌÁî°¡ ¾ø½À´Ï´Ù. ±× ¶§¹®¿¡
¿©ºÐÀÇ °ø°£ÀÌ ¾ø´Â ÇÑ, °ø°£À» Â÷ÁöÇÒ °ÍÀº ¾ø½À´Ï´Ù. ¿©ºÐÀÇ °ø°£ÀÌ ÀÖÀ¸¸é, Á¢ÂøÁ¦ ÄÄÆÛ³ÍÆ®´Â ¼öÆò ¹æÇâ, ¶Ç´Â ¼öÁ÷ ¹æÇâÀÇ ÀÌ¿ë °¡´ÉÇÑ °ø°£À» Â÷ÁöÇÕ´Ï´Ù. À̰ÍÀº Æø ȤÀº ³ôÀÌÀÇ ÃÖ´ë°ª
ÀÇ ÁöÁ¤ÀÌ ¾ø´Â ÄÄÆÛ³ÍÆ®¿Í °°½À´Ï´Ù.
public static Component createHorizontalGlue()
public static Component createVerticalGlue()
public void setLayout(LayoutManager l)
Container
³»ÀÇ setLayout
l
- »ç¿ëÇÏ´Â ·¹À̾ƿô ¸Å´ÏÀúContainer.doLayout()
,
Container.getLayout()
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 µµ ÂüÁ¶ÇϽʽÿÀ.