You are here: Home / Topics / AWT Label example in Java

AWT Label example in Java

Filed under: Java on 2023-10-25 06:38:35

// Program to use Label  AWT control.

import java.awt.*;
import java.applet.*;

/*
<applet code="LabelDemo" width=300 height=100>
</applet>
*/

public class LabelDemo extends Applet 
{
public void init() 
{
 Label l1 = new Label("Java");
 Label l2 = new Label("Programming");
 Label l3 = new Label("Examples");
 
 // add labels to applet window
 add(l1);
 add(l2);
 add(l3);
}
}

About Author:
J
Java     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.