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?
asked Jun 21, 2011 at 6:02
thatbennyguy
2985 silver badges16 bronze badges
1 Answer 1
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>
answered Jun 21, 2011 at 6:06
James Allardice
166k22 gold badges335 silver badges316 bronze badges
Sign up to request clarification or add additional context in comments.
3 Comments
Robert H
How would one one know if the client browser is using HTML5 or not? Can one use the HTML5 version from now on? is it supported by all browser? or is there a way to check?
James Allardice
The major browsers should all be fine with the HTML5 method. There is nothing wrong with continuing to use the old version for now though in my opinion.
Andrew Thompson
@Robert: "How would one one know if the client browser is using HTML5 or not?" Well, if the HTML declares itself as 3.2 or 4.01 then, no. You seem to be a newbie at both applets & HTML. This will all end in tears.
default