JavaTM Platform
Standard Ed. 6

javax.swing
클래스 SwingUtilities

java.lang.Object 
  상위를 확장 javax.swing.SwingUtilities
모든 구현된 인터페이스:
SwingConstants


public class SwingUtilities
extends Object
implements SwingConstants

Swing 의 유틸리티 메소드의 컬렉션입니다.


필드의 개요
 
인터페이스 javax.swing. SwingConstants 로부터 상속된 필드
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST
 
메소드의 개요
static Rectangle calculateInnerArea (JComponent  c, Rectangle  r)
          r 내에서 지정된 컴퍼넌트의 내부 페인트 영역의 위치와 사이즈를 포함해,r 를 돌려줍니다.
static Rectangle [] computeDifference (Rectangle  rectA, Rectangle  rectB)
          rectA 내에서 rectB 와 오버랩 하지 않는 영역을 표현하는 구형의 배열을 돌려주는데 편리합니다.
static Rectangle computeIntersection (int x, int y, int width, int height, Rectangle  dest)
          새로운 구형을 할당하지 않고 , 2 개의 구형의 공통 부분을 계산하는데 편리합니다.
static int computeStringWidth (FontMetrics  fm, String  str)
          지정된 메트릭스 (사이즈)를 가지는 폰트를 사용해 캐릭터 라인의 폭을 계산합니다.
static Rectangle computeUnion (int x, int y, int width, int height, Rectangle  dest)
          새로운 구형을 할당하지 말고 2 개의 구형의 결합 부분을 산출하는 편리한 메소드입니다.
static MouseEvent convertMouseEvent (Component  source, MouseEvent  sourceEvent, Component  destination)
          그 x 와 y 멤버가 destination 의 좌표 체계에 변환 끝난 경우를 제외해,sourceEvent 와 같은 MouseEvent 를 돌려줍니다.
static Point convertPoint (Component  source, int x, int y, Component  destination)
          source 좌표 체계의 점 (x, y)destination 좌표 체계로 변환합니다.
static Point convertPoint (Component  source, Point  aPoint, Component  destination)
          source 좌표 체계의 aPointdestination 좌표 체계로 변환합니다.
static void convertPointFromScreen (Point  p, Component  c)
          포인트를 화면 좌표로부터 컴퍼넌트의 좌표 체계로 변환합니다.
static void convertPointToScreen (Point  p, Component  c)
          포인트를 컴퍼넌트의 좌표 체계로부터 화면 좌표로 변환합니다.
static Rectangle convertRectangle (Component  source, Rectangle  aRectangle, Component  destination)
          source 좌표 체계의 aRectangledestination 좌표 체계로 변환합니다.
static Component findFocusOwner (Component  c)
          추천 되고 있지 않습니다.  1.4 이후,KeyboardFocusManager.getFocusOwner() 로 옮겨졌습니다.
static Accessible getAccessibleAt (Component  c, Point  p)
          로컬 좌표의 PointAccessible 의 아이가 보관 유지되고 있는 경우는 그것을 돌려줍니다.
static Accessible getAccessibleChild (Component  c, int i)
          객체의 n 번째의 접근성? 대응의 아이를 돌려줍니다.
static int getAccessibleChildrenCount (Component  c)
          객체내의 접근성? 대응의 아이의 수를 돌려줍니다.
static int getAccessibleIndexInParent (Component  c)
          사용자 보조의 부모에서의 이 객체의 인덱스를 돌려줍니다.
static AccessibleStateSet getAccessibleStateSet (Component  c)
          이 객체 상태를 가져옵니다.
static Container getAncestorNamed (String  name, Component  comp)
          컴퍼넌트 계층에서 comp 의 상위를 검색하기 위한 편리한 메소드이며, 발견된 name 의 최초의 객체를 돌려줍니다.
static Container getAncestorOfClass (Class <? > c, Component  comp)
          컴퍼넌트 계층에서 comp 의 상위를 검색하기 위한 편리한 메소드이며, 발견된 c 클래스의 최초의 객체를 돌려줍니다.
static Component getDeepestComponentAt (Component  parent, int x, int y)
          위치 x,y 를 내포 하는 parent 를 부모로서 가지는, 최하정도의 가시 컴퍼넌트를 돌려줍니다.
static Rectangle getLocalBounds (Component  aComponent)
          aComponent 컴퍼넌트의 구형 (0,0, bounds.width, bounds.height)을 돌려줍니다.
static Component getRoot (Component  c)
          현재의 컴퍼넌트 트리의 루트 컴퍼넌트를 돌려줍니다.
static JRootPane getRootPane (Component  c)
          c 가 하위 JRootPane 객체의 경우는, 게다가 위 JRootPane 객체를 돌려줍니다.
static ActionMap getUIActionMap (JComponent  component)
          UI 가 component 로 지정한 ActionMap 를 돌려줍니다.
static InputMap getUIInputMap (JComponent  component, int condition)
          UI 가 componentcondition 로 지정한 InputMap 를 돌려줍니다.
static Window getWindowAncestor (Component  c)
          c 의 상위의 최초의 Window 인가,cWindow 내에 포함되지 않은 경우는 null 를 돌려줍니다.
static void invokeAndWait (Runnable  doRun)
          doRun.run() 를, AWT 이벤트발송쓰레드로 비동기적으로 실행시킵니다.
static void invokeLater (Runnable  doRun)
          doRun.run()를, AWT 이벤트발송쓰레드로 비동기적으로 실행시킵니다.
static boolean isDescendingFrom (Component  a, Component  b)
          컴퍼넌트 a 가 컴퍼넌트 b 의 하위에 있는 경우,true 를 돌려줍니다.
static boolean isEventDispatchThread ()
          현재의 thread가 AWT 이벤트발송쓰레드의 경우에 true 를 돌려줍니다.
static boolean isLeftMouseButton (MouseEvent  anEvent)
          마우스 이벤트가 왼쪽 mouse button를 나타내는 경우에 true 를 돌려줍니다.
static boolean isMiddleMouseButton (MouseEvent  anEvent)
          마우스 이벤트가 중앙의 mouse button를 나타내는 경우에 true 를 돌려줍니다.
static boolean isRectangleContainingRectangle (Rectangle  a, Rectangle  b)
          ab 를 보관 유지하는 경우에 true 를 돌려줍니다.
static boolean isRightMouseButton (MouseEvent  anEvent)
          마우스 이벤트가 오른쪽 mouse button를 나타내는 경우에 true 를 돌려줍니다.
static String layoutCompoundLabel (FontMetrics  fm, String  text, Icon  icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle  viewR, Rectangle  iconR, Rectangle  textR, int textIconGap)
          아이콘의 기점 위치, 텍스트의 baseline의 기점 위치, 및 가능하면 클립 한 버젼의 복합 라벨 캐릭터 라인을 계산해 돌려줍니다.
static String layoutCompoundLabel (JComponent  c, FontMetrics  fm, String  text, Icon  icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle  viewR, Rectangle  iconR, Rectangle  textR, int textIconGap)
          아이콘의 기점 위치, 텍스트의 baseline의 기점 위치, 및 가능하면 클립 한 버젼의 복합 라벨 캐릭터 라인을 계산해 돌려줍니다.
static boolean notifyAction (Action  action, KeyStroke  ks, KeyEvent  event, Object  sender, int modifiers)
          action 가 사용 가능해, 한편 null 가 아닌 경우,actionactionPerformed 를 호출합니다.
static void paintComponent (Graphics  g, Component  c, Container  p, int x, int y, int w, int h)
          지정된 Graphics 로, 컴퍼넌트를 그립니다.
static void paintComponent (Graphics  g, Component  c, Container  p, Rectangle  r)
          지정된 Graphics 로, 컴퍼넌트를 그립니다.
static boolean processKeyBindings (KeyEvent  event)
          event 에 관련지을 수 있었던 Component 의 키 바인딩을 처리합니다.
static void replaceUIActionMap (JComponent  component, ActionMap  uiActionMap)
          component 의 UI ActionMap 를 uiActionMap 로 변경하는 편리한 메소드입니다.
static void replaceUIInputMap (JComponent  component, int type, InputMap  uiInputMap)
          component 의 UI InputMap 를 uiInputMap 로 변경하는 편리한 메소드입니다.
static void updateComponentTreeUI (Component  c)
          단순한 Look & Feel 의 변경으로, 트리내의 각 노드에 updateUI() 처리를 실시하는 것, 즉 현재의 Look & Feel 로 그 UI 프로퍼티을 초기화하는 것을 요구합니다.
static Window windowForComponent (Component  c)
          c 의 상위의 최초의 Window 인가,cWindow 내에 포함되지 않은 경우는 null 를 돌려줍니다.
 
클래스 java.lang. Object 로부터 상속된 메소드
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

메소드의 상세

isRectangleContainingRectangle

public static final boolean isRectangleContainingRectangle(Rectangle  a,
                                                           Rectangle  b)
ab 를 보관 유지하는 경우에 true 를 돌려줍니다.


getLocalBounds

public static Rectangle  getLocalBounds(Component  aComponent)
aComponent 컴퍼넌트의 구형 (0,0, bounds.width, bounds.height)을 돌려줍니다.


getWindowAncestor

public static Window  getWindowAncestor(Component  c)
c 의 상위의 최초의 Window 인가,cWindow 내에 포함되지 않은 경우는 null 를 돌려줍니다.

파라미터:
c - 상위 Window 를 취득하는 Component
반환값:
c 의 상위의 최초의 Window 인가,cWindow 내에 포함되지 않은 경우는 null
도입된 버젼:
1.3

convertPoint

public static Point  convertPoint(Component  source,
                                 Point  aPoint,
                                 Component  destination)
source 좌표 체계의 aPointdestination 좌표 체계로 변환합니다. sourcenull 의 경우,aPointdestination 의 루트 컴퍼넌트 좌표계에 있는 것과 상정됩니다. destinationnull 의 경우,aPointsource 의 루트 컴퍼넌트 좌표계에 변환됩니다. sourcedestination 가 어느 쪽과도 null 의 경우는, 변환하지 않고 aPoint 를 돌려줍니다.


convertPoint

public static Point  convertPoint(Component  source,
                                 int x,
                                 int y,
                                 Component  destination)
source 좌표 체계의 점 (x, y)destination 좌표 체계로 변환합니다. sourcenull 의 경우,(x, y)destination 의 루트 컴퍼넌트 좌표계에 있는 것과 상정됩니다. destinationnull 의 경우,(x, y)source 의 루트 컴퍼넌트 좌표계에 변환됩니다. sourcedestination 가 어느 쪽과도 null 의 경우는, 변환하지 않고 (x, y) 를 돌려줍니다.


convertRectangle

public static Rectangle  convertRectangle(Component  source,
                                         Rectangle  aRectangle,
                                         Component  destination)
source 좌표 체계의 aRectangledestination 좌표 체계로 변환합니다. sourcenull 의 경우,aRectangledestination 의 루트 컴퍼넌트 좌표계에 있는 것과 상정됩니다. destinationnull 의 경우,aRectanglesource 의 루트 컴퍼넌트 좌표계에 변환됩니다. sourcedestination 가 어느 쪽과도 null 의 경우는, 변환하지 않고 aRectangle 를 돌려줍니다.


getAncestorOfClass

public static Container  getAncestorOfClass(Class <? > c,
                                           Component  comp)
컴퍼넌트 계층에서 comp 의 상위를 검색하기 위한 편리한 메소드이며, 발견된 c 클래스의 최초의 객체를 돌려줍니다. c 클래스가 발견되지 않는 경우는 null 를 돌려줍니다.


getAncestorNamed

public static Container  getAncestorNamed(String  name,
                                         Component  comp)
컴퍼넌트 계층에서 comp 의 상위를 검색하기 위한 편리한 메소드이며, 발견된 name 의 최초의 객체를 돌려줍니다. name 가 발견되지 않는 경우는 null 를 돌려줍니다.


getDeepestComponentAt

public static Component  getDeepestComponentAt(Component  parent,
                                              int x,
                                              int y)
위치 x,y 를 내포 하는 parent 를 부모로서 가지는, 최하정도의 가시 컴퍼넌트를 돌려줍니다. parent 가 지정된 위치를 내포 하고 있지 않는 경우는,null 가 돌려주어집니다. parent 가 컨테이너가 아닌 경우, 혹은 parent 의 가시의 아이가 어느 것도 지정된 위치를 내포 하고 있지 않는 경우는,parent 가 돌려주어집니다.

파라미터:
parent - 검색을 개시하는 루트 컴퍼넌트
x - x 타겟 위치
y - y 타겟 위치

convertMouseEvent

public static MouseEvent  convertMouseEvent(Component  source,
                                           MouseEvent  sourceEvent,
                                           Component  destination)
그 x 와 y 멤버가 destination 의 좌표 체계에 변환 끝난 경우를 제외해,sourceEvent 와 같은 MouseEvent 를 돌려줍니다. sourcenull 의 경우,sourceEvent 의 x 와 y 멤버는 destination 의 루트 컴퍼넌트 좌표계에 들어가는 것과 상정됩니다. destinationnull 의 경우, 반환된 MouseEvent 는 source 의 좌표 체계에 들어갑니다. sourceEvent 는 변경되지 않습니다. 새로운 이벤트가 돌려주어집니다. destination 가 null 이외의 경우, 반환된 이벤트의 source 필드는 destination 로 설정됩니다. translateMouseEvent() 메소드를 사용하면(자), source 를 변경하지 않고 , 컴퍼넌트의 마우스 이벤트를 다른 컴퍼넌트로 변환할 수 있습니다.


convertPointToScreen

public static void convertPointToScreen(Point  p,
                                        Component  c)
포인트를 컴퍼넌트의 좌표 체계로부터 화면 좌표로 변환합니다.

파라미터:
p - 새로운 좌표 체계에 변환되는 Point 객체
c - Component 객체

convertPointFromScreen

public static void convertPointFromScreen(Point  p,
                                          Component  c)
포인트를 화면 좌표로부터 컴퍼넌트의 좌표 체계로 변환합니다.

파라미터:
p - 새로운 좌표 체계에 변환되는 Point 객체
c - Component 객체

windowForComponent

public static Window  windowForComponent(Component  c)
c 의 상위의 최초의 Window 인가,cWindow 내에 포함되지 않은 경우는 null 를 돌려줍니다.  

주:이 메소드의 기능은,getWindowAncestor 와 같습니다.

파라미터:
c - 상위 Window 를 취득하는 Component
반환값:
c 의 상위의 최초의 Window 인가,cWindow 내에 포함되지 않은 경우는 null

isDescendingFrom

public static boolean isDescendingFrom(Component  a,
                                       Component  b)
컴퍼넌트 a 가 컴퍼넌트 b 의 하위에 있는 경우,true 를 돌려줍니다.


computeIntersection

public static Rectangle  computeIntersection(int x,
                                            int y,
                                            int width,
                                            int height,
                                            Rectangle  dest)
새로운 구형을 할당하지 않고 , 2 개의 구형의 공통 부분을 계산하는데 편리합니다. 2 개의 구형이 교차하고 있지 않는 경우, 반환되는 구형은 (0,0)의 위치로부터 시작되어, 0 의 폭과 0 의 높이를 가집니다.

파라미터:
x - 최초의 구형의 좌상의 점의 X 좌표
y - 최초의 구형의 좌상의 점의 Y 좌표
width - 최초의 구형의 폭
height - 최초의 구형의 높이
dest - 2 번째의 구형
반환값:
공통 부분을 지정하기 위해서 변경된 dest

computeUnion

public static Rectangle  computeUnion(int x,
                                     int y,
                                     int width,
                                     int height,
                                     Rectangle  dest)
새로운 구형을 할당하지 말고 2 개의 구형의 결합 부분을 산출하는 편리한 메소드입니다.

파라미터:
x - 최초의 구형의 x 좌표
y - 최초의 구형의 y 좌표
width - 최초의 구형의 폭
height - 최초의 구형의 높이
dest - 2 번째의 구형의 좌표. 2 개의 구형의 화집합이 이 구형으로 반환된다
반환값:
dest Rectangle

computeDifference

public static Rectangle [] computeDifference(Rectangle  rectA,
                                            Rectangle  rectB)
rectA 내에서 rectB 와 오버랩 하지 않는 영역을 표현하는 구형의 배열을 돌려주는데 편리합니다. 2 개의 구형이 오버랩 하지 않는 경우는, 빈 상태(empty)의 배열을 돌려줍니다.


isLeftMouseButton

public static boolean isLeftMouseButton(MouseEvent  anEvent)
마우스 이벤트가 왼쪽 mouse button를 나타내는 경우에 true 를 돌려줍니다.

파라미터:
anEvent - MouseEvent 객체
반환값:
왼쪽 mouse button가 액티브했던 경우는 true

isMiddleMouseButton

public static boolean isMiddleMouseButton(MouseEvent  anEvent)
마우스 이벤트가 중앙의 mouse button를 나타내는 경우에 true 를 돌려줍니다.

파라미터:
anEvent - MouseEvent 객체
반환값:
중앙의 mouse button가 액티브했던 경우는 true

isRightMouseButton

public static boolean isRightMouseButton(MouseEvent  anEvent)
마우스 이벤트가 오른쪽 mouse button를 나타내는 경우에 true 를 돌려줍니다.

파라미터:
anEvent - MouseEvent 객체
반환값:
오른쪽 mouse button가 액티브했던 경우는 true

computeStringWidth

public static int computeStringWidth(FontMetrics  fm,
                                     String  str)
지정된 메트릭스 (사이즈)를 가지는 폰트를 사용해 캐릭터 라인의 폭을 계산합니다.

파라미터:
fm - 계산에 사용하는 FontMetrics 객체
str - 계산 대상의 String
반환값:
캐릭터 라인의 폭이 포함되고 있는 int 치

layoutCompoundLabel

public static String  layoutCompoundLabel(JComponent  c,
                                         FontMetrics  fm,
                                         String  text,
                                         Icon  icon,
                                         int verticalAlignment,
                                         int horizontalAlignment,
                                         int verticalTextPosition,
                                         int horizontalTextPosition,
                                         Rectangle  viewR,
                                         Rectangle  iconR,
                                         Rectangle  textR,
                                         int textIconGap)
아이콘의 기점 위치, 텍스트의 baseline의 기점 위치, 및 가능하면 클립 한 버젼의 복합 라벨 캐릭터 라인을 계산해 돌려줍니다. 여러분치는 viewR 의 구형을 기준에 계산됩니다. JComponent 의 방향 (LEADING 또는 TRAILING)도 고려되어 LEFT 치 또는 RIGHT 치에 변환됩니다.


layoutCompoundLabel

public static String  layoutCompoundLabel(FontMetrics  fm,
                                         String  text,
                                         Icon  icon,
                                         int verticalAlignment,
                                         int horizontalAlignment,
                                         int verticalTextPosition,
                                         int horizontalTextPosition,
                                         Rectangle  viewR,
                                         Rectangle  iconR,
                                         Rectangle  textR,
                                         int textIconGap)
아이콘의 기점 위치, 텍스트의 baseline의 기점 위치, 및 가능하면 클립 한 버젼의 복합 라벨 캐릭터 라인을 계산해 돌려줍니다. 여러분치는 viewR 의 구형을 기준에 계산됩니다. 이 layoutCompoundLabel()는, horizontalTextPosition (디폴트는 RIGHT) 및 horizontalAlignment (디폴트는 CENTER)의 LEADING 치 및 TRAILING 치를 처리할 수 없습니다. 대신에, 다른 버젼의 layoutCompoundLabel()를 사용해 주세요.


paintComponent

public static void paintComponent(Graphics  g,
                                  Component  c,
                                  Container  p,
                                  int x,
                                  int y,
                                  int w,
                                  int h)
지정된 Graphics 로, 컴퍼넌트를 그립니다. 이 메소드는, 주로 가시의 포함 관계의 계층에는 포함되지 않지만 draw에 사용되는 Component 를 draw 하기 위해서 사용됩니다. 예를 들어, draw시에 텍스트나 HTML 를 draw 하고 싶은 경우는,JLabel 의 텍스트 draw 기능을 이용해, 이 메소드로 직접 페인트 할 수가 있습니다. 이 때, 라벨을 가시의 포함 관계의 계층에 추가할 필요는 없습니다.  

이 메소드는,CellRendererPane 를 이용해, 실제의 페인트를 처리합니다. draw에 단일의 컴퍼넌트를 사용하는 경우에게만 사용하도록 해 주세요. JTable 와 같이 복수의 컴퍼넌트를 이용해 draw를 실시하는 경우는,CellRendererPane 를 직접 사용해 주세요. 그렇지 않은 경우는, 다음에 나타내도록(듯이),Component 마다 CellRendererPane 를 호출합니다.  

c 의 부모가 CellRendererPane 이 아닌 경우, 새로운 CellRendererPane 가 작성되어 거기에 c 가 추가됩니다. 또,CellRendererPanep 에 추가됩니다. c 의 부모가 CellRendererPane 이며,CellRendererPane 의 부모가 p 가 아닌 경우,CellRendererPanep 에 추가됩니다.  

컴퍼넌트는,JComponent 의 하위인지, 다른 종류의 경량 컴퍼넌트인 것이 필요합니다. 경량 컴퍼넌트란,Component isLightweight 메소드에 의해 반환되는 「경량」프로퍼티이 true 인 것 같은 컴퍼넌트입니다. Component 가 경량이 아닌 경우는, 크래쉬, 예외, 페인트 관련의 문제 등, 부정한 사태가 발생하는 일이 있습니다.

파라미터:
g - draw처의 Graphics 객체
c - draw 대상의 Component
p - 중간 Container
x - draw 영역의 좌단을 나타내는 int 치 (픽셀 단위). 그래픽스 문맥의 좌단을 기준으로 하는
y - draw 영역의 상단을 나타내는 int 치 (픽셀 단위). 그래픽스 문맥의 상단을 기준으로 하는
w - draw 영역의 폭을 나타내는 int 치 (픽셀 단위)
h - draw 영역의 높이를 나타내는 int 치 (픽셀 단위)
관련 항목:
CellRendererPane , Component.isLightweight()

paintComponent

public static void paintComponent(Graphics  g,
                                  Component  c,
                                  Container  p,
                                  Rectangle  r)
지정된 Graphics 로, 컴퍼넌트를 그립니다. 이것은,paintComponent(Graphics, Component, Container, int, int, int, int) 의 커버 메소드입니다. 자세한 것은, 이 메소드를 참조해 주세요.

파라미터:
g - draw처의 Graphics 객체
c - draw 대상의 Component
p - 중간 Container
r - draw처의 Rectangle
관련 항목:
paintComponent(Graphics, Component, Container, int, int, int, int) , CellRendererPane

updateComponentTreeUI

public static void updateComponentTreeUI(Component  c)
단순한 Look & Feel 의 변경으로, 트리내의 각 노드에 updateUI() 처리를 실시하는 것, 즉 현재의 Look & Feel 로 그 UI 프로퍼티을 초기화하는 것을 요구합니다.


invokeLater

public static void invokeLater(Runnable  doRun)
doRun.run()를, AWT 이벤트발송쓰레드로 비동기적으로 실행시킵니다. 이것은, 보류중의 모든 AWT 이벤트가 처리된 뒤에 발생합니다. 이 메소드는, 어플리케이션 thread가 GUI 를 갱신할 필요가 있을 때 사용됩니다. 다음의 예에서는,invokeLater 호출은 이벤트발송쓰레드에 Runnable 객체의 doHelloWorld 의 큐를 호출하고 나서, 메세지를 출력합니다.
 Runnable doHelloWorld = new Runnable() {
     public void run() {
         System.out.println("Hello World on " + Thread.currentThread());
     }
 };

 SwingUtilities.invokeLater(doHelloWorld);
 System.out.println("This might well be displayed before the other message. ");
 
invokeLater 가 이벤트발송쓰레드, 예를 들어 JButton 의 ActionListener 로부터 불려 갔을 경우, doRun.run()는 보류중의 모든 이벤트가 처리될 때까지 실행이 연기됩니다. 다만, doRun.run()가 캐치 되지 않는 예외를 throw 하는 경우는, 이벤트발송쓰레드 (현재의 thread는 아니다)가 상태를 바탕으로 되돌립니다.  

이 메소드의 추가의 문서와 예에 대해서는, 「The Java Tutorial」의「How to Use Threads」 를 참조해 주세요.  

JDK Version 1.3 이후, 이 메소드는 java.awt.EventQueue.invokeLater() 로만 사용됩니다.  

이 메소드는, 다른 Swing 의 메소드와는 달라, 어느 thread로부터에서도 호출할 수 있습니다.

관련 항목:
invokeAndWait(java.lang.Runnable)

invokeAndWait

public static void invokeAndWait(Runnable  doRun)
                          throws InterruptedException ,
                                 InvocationTargetException 
doRun.run() 를, AWT 이벤트발송쓰레드로 비동기적으로 실행시킵니다. 이것은, 보류중의 모든 AWT 이벤트가 처리될 때까지 블록 되어 다음에 doRun.run() 가 복귀합니다. 이 메소드는, 어플리케이션 thread가 GUI 를 갱신할 필요가 있을 때 사용됩니다. 이 메소드는,EventDispatchThread 로부터 호출하지 말아 주세요. 새로운 어플리케이션 thread를 생성하는 예를, 다음에 나타냅니다. 이 예에서는, 어플리케이션 thread는 invokeAndWait 를 사용해 이벤트발송쓰레드로부터 캐릭터 라인을 출력해, 그 후, 어플리케이션 thread로부터 캐릭터 라인을 출력합니다.
 final Runnable doHelloWorld = new Runnable() {
     public void run() {
         System.out.println("Hello World on " + Thread.currentThread());
     }
 };

 Thread appThread = new Thread() {
     public void run() {
         try {
             SwingUtilities.invokeAndWait(doHelloWorld);
         }
         catch (Exception e) {
             e.printStackTrace();
         }
         System.out.println("Finished on " + Thread.currentThread());
     }
 };
 appThread.start();
 
Runnable.run 메소드가 캐치 되지 않는 예외를 이벤트발송원thread로 throw 하는 경우는, 그 예외는 호출해 옆의 thread로,InvocationTargetException 로서 캐치 되어 재throw 되기 (위해)때문에, 주의해 주세요.  

이 메소드의 추가의 문서와 예에 대해서는, 「The Java Tutorial」의「How to Use Threads」 를 참조해 주세요.  

JDK Version 1.3 이후, 이 메소드는 java.awt.EventQueue.invokeAndWait() 로만 사용됩니다.

예외:
InterruptedException - 이벤트발송쓰레드가 doRun.run() 의 실행을 끝내는 것을 기다리는 동안에 인터럽트를 받았을 경우
InvocationTargetException - doRun 의 실행중에 예외가 throw 되는 경우
관련 항목:
invokeLater(java.lang.Runnable)

isEventDispatchThread

public static boolean isEventDispatchThread()
현재의 thread가 AWT 이벤트발송쓰레드의 경우에 true 를 돌려줍니다.  

JDK Version 1.3 이후, 이 메소드는 java.awt.EventQueue.isDispatchThread() 로만 사용됩니다.

반환값:
현재의 thread가 AWT 이벤트발송쓰레드의 경우는 true

getAccessibleIndexInParent

public static int getAccessibleIndexInParent(Component  c)
사용자 보조의 부모에서의 이 객체의 인덱스를 돌려줍니다.

주:Java 2 플랫폼 v1. 3 이후, 개발자는 이 메소드를 사용하는 대신에, Component.AccessibleAWTComponent.getAccessibleIndexInParent()를 호출하는 것을 추천합니다.

반환값:
이 객체가 사용자 보조의 부모를 가지지 않는 경우는 -1. 그렇지 않은 경우는, 사용자 보조의 부모에게 있는 아이의 인덱스

getAccessibleAt

public static Accessible  getAccessibleAt(Component  c,
                                         Point  p)
로컬 좌표의 PointAccessible 의 아이가 보관 유지되고 있는 경우는 그것을 돌려줍니다. 그렇지 않은 경우는 null 를 돌려줍니다.

반환값:
지정된 장소에 존재하는 Accessible. 그렇지 않은 경우는 null

getAccessibleStateSet

public static AccessibleStateSet  getAccessibleStateSet(Component  c)
이 객체 상태를 가져옵니다.

주:Java 2 플랫폼 v1. 3 이후, 개발자는 이 메소드를 사용하는 대신에, Component.AccessibleAWTComponent.getAccessibleIndexInParent()를 호출하는 것을 추천합니다.

반환값:
객체의 현재 상태 세트를 보관 유지하는 AccessibleStateSet 의 인스턴스
관련 항목:
AccessibleState

getAccessibleChildrenCount

public static int getAccessibleChildrenCount(Component  c)
객체내의 접근성? 대응의 아이의 수를 돌려줍니다. 이 객체의 아이의 모든 것이 Accessible 인터페이스를 구현하는 경우, 이 메소드는 이 객체의 아이의 수를 돌려주지 않으면 안됩니다.

주:Java 2 플랫폼 v1. 3 이후, 개발자는 이 메소드를 사용하는 대신에, Component.AccessibleAWTComponent.getAccessibleIndexInParent()를 호출하는 것을 추천합니다.

반환값:
객체내의 접근성? 대응의 아이의 수

getAccessibleChild

public static Accessible  getAccessibleChild(Component  c,
                                            int i)
객체의 n 번째의 접근성? 대응의 아이를 돌려줍니다.

주:Java 2 플랫폼 v1. 3 이후, 개발자는 이 메소드를 사용하는 대신에, Component.AccessibleAWTComponent.getAccessibleIndexInParent()를 호출하는 것을 추천합니다.

파라미터:
i - 제로로부터 시작되는 아이의 인덱스
반환값:
객체의 n 번째의 접근성? 대응의 아이

findFocusOwner

@Deprecated 
public static Component  findFocusOwner(Component  c)
추천 되고 있지 않습니다.  1.4 이후,KeyboardFocusManager.getFocusOwner() 로 옮겨졌습니다.

지정된 Component 의 아이 Component 가 포커스 소유자인 경우, 그 아이 Component 를 돌려줍니다.

파라미터:
c - 포커스 소유자를 검색할 때의 Component 계층 루트
반환값:
포커스 소유자. 포커스 소유자가 존재하지 않는 경우, 포커스 소유자가 comp 가 아닌 경우, 또는 포커스 소유자가 comp 의 아이인 경우는 null
관련 항목:
KeyboardFocusManager.getFocusOwner()

getRootPane

public static JRootPane  getRootPane(Component  c)
c 가 하위 JRootPane 객체의 경우는, 게다가 위 JRootPane 객체를 돌려줍니다. c 가 RootPaneContainer 의 경우는, 그 JRootPane 를 돌려줍니다.

반환값:
Component c 의 JRootPane, 또는 null

getRoot

public static Component  getRoot(Component  c)
현재의 컴퍼넌트 트리의 루트 컴퍼넌트를 돌려줍니다.

반환값:
Window 인 c 의 최초의 상위 객체, 또는 마지막 상위 Applet 객체

processKeyBindings

public static boolean processKeyBindings(KeyEvent  event)
event 에 관련지을 수 있었던 Component 의 키 바인딩을 처리합니다. 이 메소드가 편리한 것은,event.getComponent()JComponent 의 하위인 경우, 또는 JComponent 서브 클래스내로부터 super.processKeyEvent 를 호출하지 않은 경우 뿐입니다. JComponent 는, 자신의 processKeyEvent 메소드내로부터 자동적으로 바인딩을 처리하기 위해(때문에), 이 메소드를 직접 호출하는 것이 필요한 경우는 거의 없습니다.

파라미터:
event - 포커스를 가지는 Component 및 처리 대상의 바인딩을 지정하는 KeyEvent
반환값:
바인딩이 발견되어 처리되었을 경우는 true
도입된 버젼:
1.4

notifyAction

public static boolean notifyAction(Action  action,
                                   KeyStroke  ks,
                                   KeyEvent  event,
                                   Object  sender,
                                   int modifiers)
action 가 사용 가능해, 한편 null 가 아닌 경우,actionactionPerformed 를 호출합니다. ActionEvent 의 커멘드는 다음의 값으로 지정됩니다.
  1. 액션이 registerKeyboardAction 를 사용해 등록되었을 경우는, 건네받은 커멘드 캐릭터 라인 (null 가 건네받았을 경우는 null).
  2. null 가 아닌 한, Action.ACTION_COMMAND_KEY 라는 이름을 가지는 Action 치.
  3. getKeyChar 가 KeyEvent.CHAR_UNDEFINED 를 돌려주지 않는 한, KeyEvent 의 String 치
actionnull 이외로, actionPerformed 가 불려 가면(자), true 를 돌려줍니다.

도입된 버젼:
1.3

replaceUIInputMap

public static void replaceUIInputMap(JComponent  component,
                                     int type,
                                     InputMap  uiInputMap)
component 의 UI InputMap 를 uiInputMap 로 변경하는 편리한 메소드입니다. uiInputMapnull 의 경우, 이 메소드는 이전에 인스톨 된 UI InputMap 를 삭제합니다.

도입된 버젼:
1.3

replaceUIActionMap

public static void replaceUIActionMap(JComponent  component,
                                      ActionMap  uiActionMap)
component 의 UI ActionMap 를 uiActionMap 로 변경하는 편리한 메소드입니다. uiActionMapnull 의 경우, 이 메소드는 이전에 인스톨 된 UI ActionMap 를 삭제합니다.

도입된 버젼:
1.3

getUIInputMap

public static InputMap  getUIInputMap(JComponent  component,
                                     int condition)
UI 가 componentcondition 로 지정한 InputMap 를 돌려줍니다.  

이 메소드는, UI 가 지정된 형태의 InputMap 를 인스톨 하고 있지 않는 경우에 null 를 돌려줍니다.

도입된 버젼:
1.3

getUIActionMap

public static ActionMap  getUIActionMap(JComponent  component)
UI 가 component 로 지정한 ActionMap 를 돌려줍니다.  

이 메소드는, UI 가 지정된 형태의 ActionMap 를 인스톨 하고 있지 않는 경우에 null 를 돌려줍니다.

도입된 버젼:
1.3

calculateInnerArea

public static Rectangle  calculateInnerArea(JComponent  c,
                                           Rectangle  r)
r 내에서 지정된 컴퍼넌트의 내부 페인트 영역의 위치와 사이즈를 포함해,r 를 돌려줍니다. 위치와 사이즈는, 컴퍼넌트의 경계를 나타내, 경계 영역을 포함하지 않게 조정됩니다 (인 세트). 이 메소드는, 페인트 하는 코드를 구현하는 클래스에 대해서 편리합니다.

파라미터:
c - 대상의 JComponent. 이 메소드가 null 를 돌려주는 경우는 null
r - 변경되는 Rectangle 의 인스턴스. null 의 경우도 있다
반환값:
컴퍼넌트가 null 의 경우는 null. 그렇지 않은 경우는 건네받은 구형 (null 이외의 경우), 또는 위치 및 사이즈 정보를 지정하는 새로운 구형
도입된 버젼:
1.4

JavaTM Platform
Standard Ed. 6

버그의 보고와 기능의 요청
한층 더 자세한 API 레퍼런스 및 개발자 문서에 대해서는,Java SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.