The Java Applet is a special Java program that
Applet program runs on a web browser at client side.
Applet program are used to make the web site more dynamic.
Applet program embedded in a HTML page and hosted on a web server.
Applet Skeleton/ Structure
Applet skeleton is a structure/ syntax of applet program.
Any applet program created by us must be sub class of Applet class. Applet program may contain five methods:
1 2 3 4 5 | init() start() stop() destroy() paint() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import java.applet.Applet; import java.awt.Graphics; /* <applet code="AppletDemo.class" width="200" height="200"> </applet> */ public class AppletDemo extends Applet { public void init() {} public void start() {} public void stop() {} public void destroy() {} public void paint(Graphics g) {} } |