开发者

Insert JAR into html without Class file

I am trying to put a java program into a HTML page and when launch the page nothing shows up.

How do I call this applet, the only thing I have is a JAR file, I didn't write the program. Thanks all!

edit1: Also I kinda got something going but now it says mis开发者_如何学运维sing code parameter.


You'll need either a CODE attribute or an OBJECT attribute.

From the Oracle guide to embedding APPLETs:

CODE=< appletFile>

This REQUIRED attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URL of the applet. It cannot be absolute. One of CODE or OBJECT must be present. The value appletFile can be of the form classname.class or of the form packagename.classname.class.

OBJECT=< serializedApplet >

This attribute gives the name of the file that contains a serialized representation of an Applet. The Applet will be deserialized. The init() method will not be invoked; but its start() method will. Attributes valid when the original object was serialized are not restored. Any attributes passed to this APPLET instance will be available to the Applet; we advocate very strong restraint in using this feature. An applet should be stopped before it is serialized. One of CODE or OBJECT must be present.

More, and a tutorial here: http://download.oracle.com/javase/1.4.2/docs/guide/misc/applet.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜