LECTURE -62 -PROGRAMMING IN JAVA - DEVELOPING AN APPLET PROGRAM- BCA- S3.

Опубликовано: 22 Май 2026
на канале: BOSCOCAMPUSVISION
132
2

Developing an Applet Program
Steps to develop an applet program
1. Create an applet (java) code i.e. .java file.
2. Compile to generate .class file.
3. Design a HTML file with (APPLET) tag.
Running the Applet Program
There are two ways to run the applet program
1. By HTML
2. Appletviewer tool
import java.awt.*;
import java.applet.*;
public class AppletDemo
{
public void paint(Graphics g)
{
g.drawString("Welcome to Java programming", 50, 50);
}
}
1. Save the above program: AppletDemo.java
2. Compile: )javac AppletDemo.java
//AppletDemo.html
(html)
(head)
(title)AppletDemo(/title)
(/head)
(body)
(applet code="AppletDemo.class" width="200" height="250")
(/applet)
(/body)
(/html)

NOTE: To execute the applet program through appletviewer tool, write it on command prompt.
C :\)javac AppletDemo.java
C :\)appletviewer AppletDemo.html