Although w3c does not recommend the use of applets, using applets to deploy applets in the intranet is a recommended common practice, so let's first discuss the use of the
Usage of
It is a very common practice to use the
1. Here is an example of using an applet:
<applet code=Applet1.class width="200" height="200"> Your browser does not support the <code>applet</code> tag. </applet>
Generally we mainly use these attributes:
The code attribute refers to the applet class, that is Inherit With subclasses of Java.applet.Applet or java.swing.JApplet class, this attribute value must be the path to store the applet class for you;
width attribute refers to your The width that the applet will occupy in the browser
The height attribute refers to the height that your applet will occupy in the browser
2. Generally we use these attributes, but Sometimes we package the applet into a jar file, then we have to use the archive attribute, for example:
<applet code=package.Applet1.class archive="app.jar" width="200" height="200"> Your browser does not support the <code>applet</code> tag. </applet>
The meaning of this example is that it is in the app.jar file in the file where you store the html file Find the applet class package.Applet1.class. If you want to use multiple jar files, separate the jar files with English-encoded commas in the archive attribute value.
The
The function of
The
The
Which browsers support the
Some support for the
Here, in order to better let you understand how to add Java Applet to your HTML code, I will give you an example.
The following is the dynamic effect achieved using Java Applet.
<
All you have to do is add the following code to your HTML file.
<applet code="alcsnow.class" align="baseline" width="457" height="328"> <param name="grph" value="tree.gif"> <param name="snows" value="900" > <param name="threadsleep" value="50"> <请把浏览器配置成支持Java。> </applet>
The above is the detailed content of Detailed explanation of the use of