Where should we put applet class files, and how to indicate their location using the Applet tag?

Where should we put applet class files, and how to indicate their location using the Applet tag?

An applet class file may present in any of the folder. The .class file name along with its current path( in which this .html file is placed) is to be specified in the code attribute of <Applet> tag. If the .class file is not in the current directory,or in an url, the codebase attribute is used. The codebase= attribute is used to specify a different directory.

Example:
<applet codebase="http://java.sun.com/applets/NervousText/1.1" code="NervousText.class" width=400 height=75>

Applet class files & their location

The applet class files should be put in the same directory as the current HTML document. The following code indicates how to set the location:
<applet codebase=”http://careerride.com/Applet123” code="Applet123.class" width=50 height=50>
</applet>
Explain the methods that control a Applet's on-screen appearance, update and paint.
To refresh a page in an applet window without flashing, the update() method is to be overridden...
Explain how Java interacts with database.
Java interacts with database using an API called Java Database Connectivity. JDBC is used to connect to the database...
How can we handle SQL exception in Java?
SQL Exception is associated with a failure of a SQL statement. This exception can be handled like an ordinary exception in a catch block...
Post your comment