|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요 : 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Label
public class Label
Label 객체는, 컨테이너내에 텍스트를 배치하기 위한 컴퍼넌트입니다. 라벨은, 단일행의 read 전용 텍스트를 표시합니다. 텍스트를 변경하려면 어플리케이션을 사용해, 사용자가 직접 편집할 수 없습니다.
예를 나타냅니다.
setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
add(new Label("Hi There! "));
add(new Label("Another Label"));
상기의 코드는, 다음의 라벨을 작성합니다.
| 상자의 클래스의 개요 | |
|---|---|
protected class |
Label.AccessibleAWTLabel
이 클래스는 Label 클래스용의 접근성?의 지원를 구현하고 있습니다. |
| 클래스 java.awt. Component 로부터 상속된 상자의 클래스/인터페이스 |
|---|
Component.AccessibleAWTComponent , Component.BaselineResizeBehavior , Component.BltBufferStrategy , Component.FlipBufferStrategy |
| 필드의 개요 | |
|---|---|
static int |
CENTER
라벨이 centering 되는 것을 나타냅니다. |
static int |
LEFT
라벨이 왼쪽 가지런히 하고 되는 것을 나타냅니다. |
static int |
RIGHT
라벨이 오른쪽맞춤 되는 것을 나타냅니다. |
| 클래스 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 |
| 생성자 의 개요 | |
|---|---|
Label ()
빈 상태(empty)의 라벨을 구축합니다. |
|
Label (String text)
새로운 라벨을 왼쪽 가지런히 해, 지정된 텍스트 캐릭터 라인으로 구축합니다. |
|
Label (String text,
int alignment)
지정된 텍스트 캐릭터 라인을, 지정된 배치로 표시하는 새로운 라벨을 구축합니다. |
|
| 메소드의 개요 | |
|---|---|
void |
addNotify ()
이 라벨의 피어를 작성합니다. |
AccessibleContext |
getAccessibleContext ()
이 Label 에 관련한 AccessibleContext 를 돌려줍니다. |
int |
getAlignment ()
이 라벨의 현재의 배치를 돌려줍니다. |
String |
getText ()
이 라벨의 텍스트를 돌려줍니다. |
protected String |
paramString ()
이 Label 상태를 나타내는 캐릭터 라인을 돌려줍니다. |
void |
setAlignment (int alignment)
이 라벨의 배치를, 지정된 배치로 설정합니다. |
void |
setText (String text)
이 라벨의 텍스트를, 지정된 텍스트로 설정합니다. |
| 클래스 java.lang. Object 로부터 상속된 메소드 |
|---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
| 필드의 상세 |
|---|
public static final int LEFT
public static final int CENTER
public static final int RIGHT
| 생성자 의 상세 |
|---|
public Label()
throws HeadlessException
"" 입니다.
HeadlessException - GraphicsEnvironment.isHeadless()의 경우
true 를 돌려주는GraphicsEnvironment.isHeadless()
public Label(String text)
throws HeadlessException
text - 라벨이 표시하는 캐릭터 라인.
null 치를 지정해도,
NullPointerException 를 throw 하지 않고
받아들일 수 있다
HeadlessException - GraphicsEnvironment.isHeadless()의 경우
true 를 돌려주는GraphicsEnvironment.isHeadless()
public Label(String text,
int alignment)
throws HeadlessException
alignment 의 값은,Label.LEFT,Label.RIGHT,Label.CENTER 의 머지않아인가입니다.
text - 라벨이 표시하는 캐릭터 라인.
null 치를 지정해도,
NullPointerException 를 throw 하지 않고
받아들일 수 있는alignment - 배치 방법의 값
HeadlessException - GraphicsEnvironment.isHeadless()의 경우
true 를 돌려주는GraphicsEnvironment.isHeadless() | 메소드의 상세 |
|---|
public void addNotify()
Component 내의 addNotify Component.isDisplayable() ,
Component.removeNotify() public int getAlignment()
Label.LEFT,Label.RIGHT,Label.CENTER 의 머지않아인가입니다.
setAlignment(int) public void setAlignment(int alignment)
Label.LEFT,Label.RIGHT,Label.CENTER 의 머지않아인가입니다.
alignment - 설정되는 배치
IllegalArgumentException - alignment 에
올바르지 않은 값이 지정되었을 경우getAlignment() public String getText()
null 에
설정되어 있는 경우는 nullsetText(java.lang.String) public void setText(String text)
text - 이 라벨이 표시하는 텍스트.
text 가 null 의 경우는,
빈 상태(empty)의 캐릭터 라인 "" 으로서
처리되는getText() protected String paramString()
Label 상태를 나타내는 캐릭터 라인을 돌려줍니다. 이 메소드는 디버그 전용이며, 반환되는 캐릭터 라인의 내용 및 형식은 구현에 따라서 다릅니다. 반환되는 캐릭터 라인은 빈 상태(empty)의 경우가 있습니다만,null 로는 되지 않습니다.
Component 내의 paramString public AccessibleContext getAccessibleContext()
Accessible 내의 getAccessibleContext Component 내의 getAccessibleContext
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요 : 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.