Class Label

Class java.awt.Label

Class Members | This Package | All Packages
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Label

public class Label
extends Component

A Label object is a component for placing text in a container. A label displays a single line of read-only text. The text can be changed by the application, but a user cannot edit it directly.

For example, the code . . .


 setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10)); 
 add(new Label("Hi There!")); 
 add(new Label("Another Label"));
 

produces the following label: