//importing the packages
import java.applet.*;
import java.awt.*;
//this will include the class file for running in the browser
/*<applet code="FirstApplet.java" width=100 height=100 ><
/applet
>*/
//main function begins here
public class FirstApplet extends Applet{
public void paint(Graphics g){
//it will prints the string in the applet viewer
g.drawString("Welcome in Java Applet.",40,20);
}
}
Save the above program as FirstApplet.java
compile the program by using javac FirstApplet.java
execute the program by
appletviewer FirstApplet.java or appletviewer FirstApplet.html
the out put of the above program will be