0

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

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

3 Comments

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?
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.
@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.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.