Java AWT Label Class Constructors

There are three types of Java AWT Label Class

1. Label():
Creates Empty Label.

2. Label(String str):
Constructs a Label with str as its name.

3. Label(String str, int x):
Constructs a label with the specified string and x as the specified alignment

Java AWT Label

Abstract Window Toolkit (AWT) was Java’s first GUI framework, and it has been part of Java since version 1.0. It contains numerous classes and methods that allow you to create windows and simple controls. Controls are components that allow a user to interact with your application in various ways.

The AWT supports the following types of controls:

  • Labels
  • Push buttons
  • Checkboxes
  • Choice lists
  • Lists
  • Scroll bars
  • Text Editing

The easiest control to use is a label. A Label is an object of type Label (class in java.awt.Component), and it contains a string, which it displays within a container. Labels are passive controls that do not support any interaction with the user. To create a label, we need to create the object of the Label class.

Similar Reads

What is Label in Java AWT?

Label in Java AWT is a component for placing text or images in a container. The text displayed in the Container (Display) by Java AWT Label can’t be edited directly by the user but needs the programmer to change it from his side....

Java AWT Label Class Constructors

There are three types of Java AWT Label Class...

Java AWT Label Fields

Java AWT Labels have 3 fields there can also be determined as the java.awt.Component class fields. All of them are mentioned below:...

Java AWT Label Class Methods

There are a few predefined Methods associated with Java AWT Label as mentioned below:...

Methods inherited

The Methods provided with AWT Label is inherited by classes mentioned below:...

Java AWT Label Examples

There are certain cases associated with Java AWT Label so let us explore them as examples below:...

Conclusion

...

Java AWT Label – FAQs

...