|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.awt
Class Label

java.lang.Objectjava.awt.Component
java.awt.Label
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, MenuContainer, java.io.Serializable
- public class Label
- extends Component
- implements javax.accessibility.Accessible
- extends Component
This component is used for displaying simple text strings that cannot be edited by the user.
| Nested Class Summary | |
protected class |
Label.AccessibleAWTLabel
This class provides accessibility support for the label. |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy, Component.HeavyweightInLightweightListener |
| Field Summary | |
private int |
alignment
|
static int |
CENTER
Alignment constant aligning the text in the center of its window. |
static int |
LEFT
Alignment constant aligning the text to the left of its window. |
static int |
RIGHT
Alignment constant aligning the text to the right of its window. |
private static long |
serialVersionUID
|
private java.lang.String |
text
|
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
Label()
Initializes a new instance of Label with no text. |
|
Label(java.lang.String text)
Initializes a new instance of Label with the specified
text that is aligned to the left. |
|
Label(java.lang.String text,
int alignment)
Initializes a new instance of Label with the specified
text and alignment. |
|
| Method Summary | |
void |
addNotify()
Notifies this label that it has been added to a container, causing the peer to be created. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this Label. |
int |
getAlignment()
Returns the constant indicating the alignment of the text in this label. |
java.lang.String |
getText()
Returns the text displayed in this label. |
protected java.lang.String |
paramString()
Returns a parameter string useful for debugging. |
void |
setAlignment(int alignment)
Sets the text alignment of this label to the specified value. |
void |
setText(java.lang.String text)
Sets the text in this label to the specified value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
LEFT
public static final int LEFT
- Alignment constant aligning the text to the left of its window.
- See Also:
- Constant Field Values
CENTER
public static final int CENTER
- Alignment constant aligning the text in the center of its window.
- See Also:
- Constant Field Values
RIGHT
public static final int RIGHT
- Alignment constant aligning the text to the right of its window.
- See Also:
- Constant Field Values
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
alignment
private int alignment
text
private java.lang.String text
| Constructor Detail |
Label
public Label()
- Initializes a new instance of
Labelwith no text.
Label
public Label(java.lang.String text)
- Initializes a new instance of
Labelwith the specified text that is aligned to the left.
Label
public Label(java.lang.String text, int alignment)
- Initializes a new instance of
Labelwith the specified text and alignment.
| Method Detail |
getAlignment
public int getAlignment()
- Returns the constant indicating the alignment of the text in this
label. The value returned will be one of the alignment constants
from this class.
setAlignment
public void setAlignment(int alignment)
- Sets the text alignment of this label to the specified value.
getText
public java.lang.String getText()
- Returns the text displayed in this label.
setText
public void setText(java.lang.String text)
- Sets the text in this label to the specified value.
addNotify
public void addNotify()
- Notifies this label that it has been added to a container, causing
the peer to be created. This method is called internally by the AWT
system.
paramString
protected java.lang.String paramString()
- Returns a parameter string useful for debugging.
- Overrides:
paramStringin classComponent
getAccessibleContext
public javax.accessibility.AccessibleContext getAccessibleContext()
- Gets the AccessibleContext associated with this
Label. The context is created, if necessary.- Specified by:
getAccessibleContextin interfacejavax.accessibility.Accessible- Overrides:
getAccessibleContextin classComponent
|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC