Question 2: HTML and Java Applets
An applet is a Java Program embedded in a web page that has an <applet> or <object> tag embedded in it. The <applet> tag enables a user that has Java Programs on the web to create interactive graphics. It also allows the user to specify the location of the file they would like to run, and the height and width of the applet inside the page. A user can also specify the values of the various perimeters that they want to use. The applets can also help in coming up with an alternate HTML code just in case the browser does not support the applets.
. An applet is well suited for functions like visualization and demonstration. When a user visits a HTML page that is embedded with an applet, the code for the applet is downloaded into the user’s machine. Applets have strict security rules that are enforced by the web browser. A java Applet can be combined with HTML to create a Java Program that can run inside the web browser. Java applets are executed in a sandbox by most web browsers which prevents them from accessing local data or file systems. The code of the applet is downloaded from a web server and the browser embeds it into the web page b or opens a new window showing the applet’s user interface.
The Java applet comes with class file (.class). this file has to be the web page for the applet to work. This file come with an applet program is ready to use. Having the .class file on the site you are visiting is not enough. One needs to input a HTML code in the page that the applet will be run. The HTML code is what the applet program creates. The HTML code tells the .class file how to customize the applet. Thee customization may include things like clor, size, the images that are needed and many more.
Anil H. (2000) Applets: Still Essential to Java (How do applets fit into the big picture now) retrieved from www.javaworld.com/article/20176251/core-java/applets-still-essential-to-java-.html