|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Objectjava.util.EventObject
java.awt.AWTEvent
java.awt.event.ComponentEvent
java.awt.event.FocusEvent
public class FocusEvent
Component 가 입력초점을 취득 또는 잃은 것을 나타내는, 저레벨의 이벤트입니다. 이 저레벨 이벤트는, TextField 등의 Component 에 의해 생성됩니다. 발생한 이벤트는, Component 의 addFocusListener
메소드를 사용해, 이런 종류의 이벤트를 받도록(듯이) 등록되어 모든 FocusListener
객체 또는 FocusAdapter
객체에게 건네집니다 (FocusAdapter
객체는,FocusListener
인터페이스를 구현하고 있다). 각 청취자 객체는, 이벤트가 발생했을 때에 FocusEvent
를 가져옵니다.
포커스 이벤트에는, 영구와 텐포라리의 2 개의 레벨이 있습니다. 영구 포커스 변경 이벤트는, requestFocus()를 호출하거나 사용자가 Tab 키를 사용해 Component 를 횡단(traverse) 하거나 하는 경우 등, 포커스가 있는 Component 로부터 다른 Component 에 직접 이동할 경우에 발생합니다. 텐포라리포카스 변경 이벤트는, Window 가 액티브하지 않게 되거나 스크롤 바를 드래그 하는 경우 등, 다른 조작의 간접적인 결과적으로 Component 에 대한 포커스를 일시적으로 잃는 경우에 발생합니다. 이 경우, 그 조작이 종료하면(자) 원의 포커스 상태가 자동적으로 복원됩니다. 또, Window 가 액티브하지 않게 되었을 경우에는, 다시 액티브하게 되었을 때에 원의 포커스 상태가 자동적으로 복원됩니다. 영구 포커스 변경 이벤트와 텐포라리포카스 변경 이벤트는 양쪽 모두, FOCUS_GAINED 와 FOCUS_LOST 이벤트 식별자를 사용해 발행됩니다. 이벤트의 레벨의 차이는, isTemporary() 메소드를 사용해 구별할 수 있습니다.
FocusAdapter
,
FocusListener
,
「Tutorial: Writing a Focus Listener」,
직렬화 된 형식 필드의 개요 | |
---|---|
static int |
FOCUS_FIRST
포커스 이벤트 식별자에 사용하는 정수의 범위에 있는, 최초의 번호입니다. |
static int |
FOCUS_GAINED
이 이벤트는, 현재 Component 가 포커스의 소유자인 것을 나타냅니다. |
static int |
FOCUS_LAST
포커스 이벤트 식별자에 사용하는 정수의 범위에 있는, 마지막 번호입니다. |
static int |
FOCUS_LOST
이 이벤트는, 현재 Component 가 포커스의 소유자가 아닌 것을 나타냅니다. |
클래스 java.awt.event. ComponentEvent 로부터 상속된 필드 |
---|
COMPONENT_FIRST , COMPONENT_HIDDEN , COMPONENT_LAST , COMPONENT_MOVED , COMPONENT_RESIZED , COMPONENT_SHOWN |
클래스 java.util. EventObject 로부터 상속된 필드 |
---|
source |
생성자 의 개요 | |
---|---|
FocusEvent (Component source,
int id)
FocusEvent 객체를 구축해, 포커스의 변경이 영구인가 어떤가를 판정합니다. |
|
FocusEvent (Component source,
int id,
boolean temporary)
FocusEvent 객체를 구축해, 변경이 텐포라리인가 어떤가를 판정합니다. |
|
FocusEvent (Component source,
int id,
boolean temporary,
Component opposite)
지정된 텐포라리 상태로, 반대의 Component 를 가지는 FocusEvent 객체를 구축합니다. |
메소드의 개요 | |
---|---|
Component |
getOppositeComponent ()
이 포커스 변경에 관계하는 이제(벌써) 한편의 Component 를 돌려줍니다. |
boolean |
isTemporary ()
포커스 변경 이벤트가 텐포라리인지, 영구인지를 나타냅니다. |
String |
paramString ()
이 이벤트를 특정하는 파라미터의 캐릭터 라인을 돌려줍니다. |
클래스 java.awt.event. ComponentEvent 로부터 상속된 메소드 |
---|
getComponent |
클래스 java.awt. AWTEvent 로부터 상속된 메소드 |
---|
consume , getID , isConsumed , setSource , toString |
클래스 java.util. EventObject 로부터 상속된 메소드 |
---|
getSource |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
필드의 상세 |
---|
public static final int FOCUS_FIRST
public static final int FOCUS_LAST
public static final int FOCUS_GAINED
public static final int FOCUS_LOST
생성자 의 상세 |
---|
public FocusEvent(Component source, int id, boolean temporary, Component opposite)
Component
를 가지는 FocusEvent
객체를 구축합니다. 반대의 Component
란, 포커스 변경에 관계하는 이제(벌써) 한편의 Component
입니다. FOCUS_GAINED
이벤트의 경우, 이것은 포커스를 잃은 Component
입니다. FOCUS_LOST
의 경우, 이것은 포커스를 취득한 Component
입니다. 이 포커스 변경이, 네이티브 어플리케이션이나 다른 VM 의 Java 어플리케이션으로 발생하는 경우, 또는 이제 한편의 Component
를 전혀 사용하지 않고에 행해지는 경우는, 반대의 Component
는 null
가 됩니다.
무효인 id
를 건네주어, 특정할 수 없는 동작을 발생시키지 않게 해 주세요. 이 메소드는 source
가 null
의 경우에 IllegalArgumentException
를 throw 합니다.
source
- 이벤트의 발생원의 Component
id
- FOCUS_GAINED
또는 FOCUS_LOST
temporary
- 포커스 변경이 텐포라리의 경우는 true
,
그렇지 않은 경우는 false
opposite
- 포커스 변경에 관계하는 이제(벌써) 한편의 Component,
또는 null
IllegalArgumentException
- source
가 null 의 경우public FocusEvent(Component source, int id, boolean temporary)
FocusEvent
객체를 구축해, 변경이 텐포라리인가 어떤가를 판정합니다.
무효인 id
를 건네주어, 특정할 수 없는 동작을 발생시키지 않게 해 주세요. 이 메소드는 source
가 null
의 경우에 IllegalArgumentException
를 throw 합니다.
source
- 이벤트의 발생원의 Component
id
- 이벤트의 형태를 나타내는 정수temporary
- 포커스 변경이 텐포라리의 경우는 true
,
그렇지 않은 경우는 false
IllegalArgumentException
- source
가 null 의 경우public FocusEvent(Component source, int id)
FocusEvent
객체를 구축해, 포커스의 변경이 영구인가 어떤가를 판정합니다.
무효인 id
를 건네주어, 특정할 수 없는 동작을 발생시키지 않게 해 주세요. 이 메소드는 source
가 null
의 경우에 IllegalArgumentException
를 throw 합니다.
source
- 이벤트의 발생원의 Component
id
- 이벤트의 형태를 나타내는 정수
IllegalArgumentException
- source
가 null 의 경우메소드의 상세 |
---|
public boolean isTemporary()
true
,
그렇지 않은 경우는 false
public Component getOppositeComponent()
public String paramString()
ComponentEvent
내의 paramString
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.