java.awt
Class Label
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Label
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable
This component is used for displaying simple text strings that cannot
be edited.
Authors:- Aaron M. Renn (arenn@urbanophile.com)
- Tom Tromey <tromey@cygnus.com>
CENTER
public static final int CENTER
Alignment constant aligning the text in the center of its window.
LEFT
public static final int LEFT
Alignment constant aligning the text to the left of its window.
RIGHT
public static final int RIGHT
Alignment constant aligning the text to the right of its window.
Label
public Label()
Initializes a new instance of Label
with no text.
Throws:
Label
public Label(java.lang.String text)
Initializes a new instance of Label
with the specified
text that is aligned to the left.
Parameters:
Throws:
Label
public Label(java.lang.String text, int alignment)
Initializes a new instance of Label
with the specified
text and alignment.
Parameters:
Throws:
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.
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.
Returns:
- The alignment of the text in the label.
getText
public String getText()
Returns the text displayed in this label.
Returns:
paramString
protected String paramString()
Returns a parameter string useful for debugging.
setAlignment
public synchronized void setAlignment(int alignment)
Sets the text alignment of this label to the specified value.
Parameters:
setText
public synchronized void setText(java.lang.String text)
Sets the text in this label to the specified value.
Parameters: