<APPLET
    CODEBASE = codebaseURL
    ARCHIVE = archiveList
    CODE = appletFile...or...  OBJECT = serializedApplet
    ALT = alternateText
    NAME = appletInstanceName
    WIDTH = pixels  HEIGHT = pixels
    ALIGN = alignment
    VSPACE = pixels  HSPACE = pixels
    >
        <PARAM NAME = appletAttribute1 VALUE = value>
        <PARAM NAME = appletAttribute2 VALUE = value>
        . . .
        alternateHTML
</APPLET>
<applet code="SimpleApplet.class"></applet>Or set size for the applet explicitly:
<applet code="SimpleApplet.class" width=”125” height=”125”></applet>
<applet archive="SimpleApplet.jar" code="net.codejava.applet.SimpleApplet.class"> </applet>That displays the applet bundled in a jar file named SimpleApplet.jar and the applet class file is SimpleApplet resides under the package net.codejava.applet.
<applet archive="SimpleApplet.jar" code="net.codejava.applet.SimpleApplet.class"> <param name="user" value="tom"> <param name="password" value="secret"> </applet>
String user = getParameter("user");
String password = getParameter("password"); <applet archive="SimpleApplet.jar, mail.jar, video.jar" code="net.codejava.applet.SimpleApplet.class"> </applet>In the above code, we specify two additional jar files mail.jar and video.jar which are required by the applet. The jar files are separated by commas. If the jar files in a directory:
<applet archive="SimpleApplet.jar, lib/mail.jar, lib/video.jar" code="net.codejava.applet.SimpleApplet.class"> </applet>In the above code, the additional jar files are placed under lib directory.
<applet archive="SimpleApplet.jar" code="net.codejava.applet.SimpleApplet.class" alt="You need to have compatible browser to run this Java applet"> Your browser does not support running applet. <br> Please install Java Plug-in from <a href="http://java.com">java.com</a> </applet>In the above code, we use the altattribute and alternate HTML text between the opening and closing elements of the <applet> tag to tell the browse should display that information if it cannot run the applet.
 Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.