The Label is a Component that displays a single line of static text.
public class java.awt.Label extends java.awt.Component { // Constants public static final int CENTER; public static final int LEFT; public static final int RIGHT; // Constructors public Label(); public Label (String label); public Label (String label, int alignment); // Instance Methods public void addNotify(); public int getAlignment(); public String getText(); public synchronized void setAlignment (int alignment); public synchronized void setText (String label); // Protected Instance Methods protected String paramString(); }
Constant to center text within the label.
Constant to left justify text within the label.
Constant to right justify text within the label.
Constructs a Label object with the text centered within the label.
The text for the label
Constructs a Label object with the text label centered within the label.
The text for the label
The alignment for the label; one of the constants CENTER, LEFT, or RIGHT.
If alignment is not one of CENTER, LEFT, or RIGHT.
Constructs a Label object, with a given alignment and text of label.
Component.addNotify()
Creates Label's peer.
Current alignment.
Current text of Label.
New alignment for Label; CENTER, LEFT, or RIGHT.
If alignment is not one of CENTER, LEFT, or RIGHT.
Changes the current alignment of Label.
New text for Label.
Changes the current text of Label.
String with current settings of Label.
Component.paramString()
Helper method for toString() to generate string of current settings.
Component, String