Java java.awt Label fields, constructors, methods, implement or subclass

Example usage for Java java.awt Label fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt Label.

The text is from its open source code.

Subclass

java.awt.Label has subclasses.
Click this link to see all its subclasses.

Field

intLEFT
Indicates that the label should be left justified.
intCENTER
Indicates that the label should be centered.
intRIGHT
Indicates that the label should be right justified.

Constructor

Label(String text)
Constructs a new label with the specified string of text, left justified.
Label(String text, int alignment)
Constructs a new label that presents the specified string of text with the specified alignment.
Label()
Constructs an empty label.

Method

StringgetText()
Gets the text of this label.
voidhide()
voidsetAlignment(int alignment)
Sets the alignment for this label to the specified alignment.
voidsetBackground(Color c)
Sets the background color of this component.
voidsetFont(Font f)
Sets the font of this component.
voidsetForeground(Color c)
Sets the foreground color of this component.
voidsetSize(int width, int height)
Resizes this component so that it has width width and height height .
voidsetText(String text)
Sets the text for this label to the specified text.
voidsetVisible(boolean b)
Shows or hides this component depending on the value of parameter b .
voidshow()
Dimensionsize()
Returns the size of this component in the form of a Dimension object.