A label is a simple control which is used to display text (non-editable) on the window. Since it does not possess any user interactive feature, it is considered as a passive control. A label is an object of

JLabel class.

Some of the constructors defined byJLabel class are as follows.

JLabel ()

JLabel(String string)

JLabel(String string, int align)

where,

string is the text used for the label

align specifies the horizontal alignment of the text contained in the label, and can have one of the following values:LEFT,RIGHT,CENTER,LEADING or TRAILING.