Module java.desktop
Package java.awt

Class Label

java.lang.Object
java.awt.Component
java.awt.Label
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Label extends Component implements Accessible
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 labels:

Two labels: 'Hi There!' and
 'Another label'

Since:
1.0
See Also: