Java Reference
In-Depth Information
Finally, it is possible for the code to reside at a completely different URL address,
such as in this example:
<applet
code ="HelloWorld.class"
codebase ="http://xyz.edu/Course/Code/Java/Beginners/HelloWorld/"
width ="100" height ="100">
</applet>
The applet tag also accepts JAR files in the codebase. In fact, use of the JAR
format is recommended because all the required class files can be obtained in
one download operation rather than in several downloads, one for each class file.
In addition the JAR format is compressed, further saving download time.
For J2SE 5.0 applets, the highly compressed pack200 format (see Sec-
tion 5.6.3) can also be used. Most browsers only support Java version 1.1, so
the pack200 format is of little use for those browsers. However, the Java Plug-in
is available for the Java 2 Platform for versions 1.2 and up. The Java Plug-in
is a browser plug-in that works with Microsoft Internet Explorer and Mozilla
browsers to enable Java 2 support in those browsers. (See Web Course Chapter 1:
Supplements and reference [1]). The Java Plug-in has been updated in J2SE 5.0
to support the pack200 format.
5.9 Javadoc
The javadoc tool provided with the SDK provides for automatic organization
of package and class documentation. Applying the tool to a package results in a
set of web pages that list the fields and methods of each class. The Javadoc API
is quite powerful. The entire voluminous Java API Specification documentation
is created with javadoc .
Yo u can add comments and other information describing the class in the source
files with the use of special tags, and these then appear in the javadoc web pages.
We noted in Chapter 2 that Java recognizes a block of comments bracketed with
/**. . .*/ in addition to the usual /*. . .*/ . The double asterisks tell
javadoc to include the comments in its documentation output. For example,
here is a HelloWorld.java file commented in the Javadoc style:
import java.applet.Applet;
import java.awt.Graphics;
/** This applet tests graphics.
* (This comment block that describes a class must be
* placed immediately before the class line.)
*/
public class HelloWorld extends Applet {
 
Search WWH ::




Custom Search