All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Label

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Label

public class Label
extends Component
A component that displays a single line of read-only text.


Variable Index

 o CENTER
The center alignment.
 o LEFT
The left alignment.
 o RIGHT
The right alignment.

Constructor Index

 o Label()
Constructs an empty label.
 o Label(String)
Constructs a new label with the specified String of text.
 o Label(String, int)
Constructs a new label with the specified String of text and the specified alignment.

Method Index

 o addNotify()
Creates the peer for this label.
 o getAlignment()
Gets the current alignment of this label.
 o getText()
Gets the text of this label.
 o paramString()
Returns the parameter String of this label.
 o setAlignment(int)
Sets the alignment for this label to the specified alignment.
 o setText(String)
Sets the text for this label to the specified text.

Variables

 o LEFT
Properties Public Constant 
   LEFT=int 
The left alignment.

 o CENTER
Properties Public Constant 
   CENTER=int 
The center alignment.

 o RIGHT
Properties Public Constant 
   RIGHT=int 
The right alignment.

Constructors

 o Label
    method Label() public 
Constructs an empty label.

 o Label
    method Label(text=String) public 
Constructs a new label with the specified String of text.

Parameters:
text - the text that makes up the label
 o Label
    method Label(text=String, -
                 alignment=int) public 
Constructs a new label with the specified String of text and the specified alignment.

Parameters:
text - the String that makes up the label
alignment - the alignment value

Methods

 o addNotify
    method addNotify()  public     
Creates the peer for this label. The peer allows us to modify the appearance of the label without changing its functionality.

Overrides:
addNotify in class Component
 o getAlignment
    method getAlignment() returns int public     
Gets the current alignment of this label.

See Also:
setAlignment
 o setAlignment
    method setAlignment(alignment=int)  public    protect 
Sets the alignment for this label to the specified alignment.

Parameters:
alignment - the alignment value
Throws: IllegalArgumentException
If an improper alignment was given.
See Also:
getAlignment
 o getText
    method getText() returns String public     
Gets the text of this label.

See Also:
setText
 o setText
    method setText(text=String)  public    protect 
Sets the text for this label to the specified text.

Parameters:
text - the text that makes up the label
See Also:
getText
 o paramString
    method paramString() returns String Inheritable     
Returns the parameter String of this label.

Overrides:
paramString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index