explain the applet element applets are embedded


Explain the applet Element ?

Applets are embedded in web pages by using the and tags. The APPLET element is same to the IMG element. Like IMG APPLET references a source file in which is not part of the HTML page on that it is embedded. IMG elements do this along with the SRC attribute. APPLET elements do this along with the CODE attribute. The CODE attribute tells the browser whereas to look for the compiled .class file. It is associative to the location of the source document. If the applet resides somewhere other than the similar directory as the page it lives on, you don't just provide a URL to its location. Rather you point at the CODEBASE. The CODEBASE attribute contains a URL that points at the directory where the .class file is. The CODE attribute is the name of the .class file itself. For instance if on the HTML page of the previous section you had written

< applet code="HelloWorldApplet" codebase="classes"
width="200" height="200">
< /applet>
then the browser would have tried to find HelloWorldApplet.class in the classes directory in the similar directory as the HTML page that involved the applet. Instead if you had written
< applet code="HelloWorldApplet"
codebase="https://www.foo.bar.com/classes" width="200" height="200">
< /applet>
In short the applet viewer will try to retrieve the applet from the URL given through the formula (CODEBASE + "/" + code). Once this URL is created all the usual rules about assoiative and absolute URLs apply.
If the applet is in a non-default package, then the full package qualified name must be used. For instance,
< applet code="com.macfaq.greeting.HelloWorldApplet"
codebase="https://www.example.com/classes" width="200" height="200">
< /applet>

The HEIGHT and WIDTH attributes work very as they do with IMG, specifying how big a rectangle the browser should set aside for the applet. These numbers are specified in pixels and are needed.

Request for Solution File

Ask an Expert for Answer!!
Application Programming: explain the applet element applets are embedded
Reference No:- TGS0285044

Expected delivery within 24 Hours