JAVA-MANI.BLOGSPOT.COM
Wednesday, June 25, 2008

Applets are intended to be viewed from within XHTML documents. In XHTML the applet or object element is placed where desired in the body element of the document. Note: The applet element has been deprecated and may only be used in Transitional documents. To use a Strict doctype you must convert any applet element to an object element. An applet skeleton is as follows:

Browser does not allow Java!

code points to the previously compiled applet class that is in a separate file. codebase points to the folder that the class file is in. A good choice is place the class folder under the html document. Be sure to explicitly point at the codebase starting at the html document. If you need to start at the root, use file:///C:/. Anything else fails in FireFox! height and width are also required parameters and cannot be moved into style rules. Nested param element(s) are optional and can be used to feed data to the applet from the XHTML document. Always include a message for non-java browsers between the applet element tags. The resulting display is:

Browser does not allow Java!

The equivalent object element skeleton syntax is:

Browser does not allow Java in object elements!

And it would appear as:

Browser does not support Java in object element!

Note 1: Remember that filenames are case sensitive in Java. Some browsers may allow helloworld.class but Opera obeys the rule! Always test any applet on as many browsers as you can.

Note 2: Although styling attributes such as align, hspace and vspace are mentioned in many texts, they are archaic and should be replaced by CSS style rules. And of course all XHTML documents should have a doctype and validate to current w3.org recommendations.

0 comments:

SUBSCRIBE VIA eMAIL

Enter your email address:

Delivered by FeedBurner

Recent Posts

Firefox 3

Counter

internet companies

Live Traffic Map

Subscribe Now