简体   繁体   中英

Simple HTML page + Java applet

How would I go about creating a simple free webpage containing one applet of a single .class file?

Say I've got this applet "G.class", and I want to host this on a free website hosting service etc.

Can anyone please tell me how to do the above?

Depending on the HTML doctype you are using, there are a couple of ways of doing this. This is the 'old' way:

<applet code="something.class" archive="something.jar" height="300" width="550">
  Failed.
</applet>

The 'new' way (if you're using HTML5) is to use an object element:

<object type="application/x-java-applet" height="300" width="550">
  <param name="code" value="something" />
  <param name="archive" value="something.jar" />
  Failed.
</object>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM