A label is used to display a string. Label class is a sub class of Component class.
Types of constructors defined by Label class:
Type-1: To create an empty label.
Type-2: To create a label having left justified str as string.
Type-3: To create a label having alignment set by align. Its values could be Label.CENTER, Label.LEFT, or Label.RIGHT.
Label(String str, int align)
Methods defined by Label class:
setText( ) method: It is used to set text in a label.
void setText(String str)
getText( ) method: It is used to get text in a label.
String getText( )
setAlignment( ) method: It is used to set alignment of string.
void setAlignment(int align)
getAlignment( ) method: It is used to get alignment of string.
int getAlignment( )