questions on deploying an applet?
I am using开发者_运维知识库 Eclipse to develop an applet module, which requires a bunch of libraries. It runs correctly under the Eclipse environment. I would like to know how to embedded this code in a html page, or how to deploy this applet?
For a code snippet, something like this will work within an html page to run your applet:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<applet height="90%" width="90%" archive="myJavaClasses.jar" code="my/java/applet.class" />
</body>
</html>
Due to the amount of technologies involved in making this work correctly for the end-user, I would strongly suggest that you learn how these things interact well before proceeding.
A good place to start is the Java Tutorial section on applets which details how deployment work.
Here are some options:
- Use this script to avoid compatibility issues.
- Use the good and old Applet Tag.
- Use Java Web Start.
There are a number of solutions, and depending on your existing web infrastructure, you might find one superior to another.
Generally, in the web page, you add tags (either <applet ...>
or <object ...>
) to the document where you wish the applet to be inserted, and the contents of the tab reference the JAR file which the web browser will then download.
.. applet module, which requires a bunch of libraries.
Add a reference to each library Jar in the archive
attribute of the applet
element.
精彩评论