Applet to display a Message

Aim:
To develop an applet that displays a simple message.

Description: 
An applet is a Java program that runs in a browser. Unlike Java applications applets do not have a main () method. To create applet we can use java.applet.Applet. All applets inherit the super class ‘Applet’. An Applet class contains several methods that help to control the execution of an applet. Let the Applet class extends Applet. Provide paint () method in that class. Using drawstring () method of Graphics class display the message on the applet.

Program:
import java.io.*;
import java.awt.*;
import java.applet.Applet;
/*<applet code="App1.class" height=100 width=500></applet>*/
public class App1 extends Applet
{
public void paint(Graphics g)
{
g.drawString("MCA III semester Students",50,60);
setForeground(Color.blue);
}
}