Internet Spec List


Java is a portable language created by Sun that creates distributable, tokenized objects. If you need to write programs that are transparently portable across the Internet, Java is the way to go.

Java References

- Java API (1.0)
- Java API (1.1 Beta)
- Java Developer's Kit (1.02)
- Java Developer's Kit (1.1)
- Sun's Java Specifications
- Java Distributed Systems & Remote Method Invocation (RMI)
- Java Beans Specifications
- Java Archive (JAR) Draft 1.0
- Netscape's JavaScript Specs
- Netscape's JSObject Java/JavaScript Class
- Grafman's Java Info

Java Class Libraries

- Microsoft's Java Gallery
- Symantec's Cafe' ISV List
- Markus Reith's list of Java Class Libraries

Compiling Java Applets (Windows)

After downloading and installing the JDK, set your PATH to include the java\bin directory and the CLASSPATH environment variable to the java\lib directory.

Then use the javac compiler to tokenize your application/applet: javac, where is the source file name.

Note: javac was written by unix-types -- while the compiler is not case sensitive in finding your source file, it will fail if the case doesn't match the public name defined in the source -- after it has spent several minutes compiling your applet!

Remember to use getCodeBase and getDocumentBase to find auxiliary files, if they are not guaranteed to be in the same directory as the referring URL calling the applet.

Embedding Java Applets in HTML

Java applets are exposed in Java-capable browsers via the APPLET HTML tag:

    <APPLET CODE="JavaApplet.class" WIDTH=200 HEIGHT=150></APPLET>

The applet code (JavaApplet.class) and any auxiliary files are assumed to be in the same directory/folder as the HTML document refering to it.

Here's a more complex example of an APPLET tag:

    CODE="Spin.class" WIDTH=150 HEIGHT=150>
    <PARAM NAME="model" VALUE="models/dome.obj">
    If you upgrade your web browser to one that supports Java, you will see a spinning dome here.

CODEBASE indicates the location of the applet's code and the PARAM tag passes parameters to the applet. The BLOCKQUOTE tag is ignored by Java-compliant browsers, but displayed by browsers that do not support Java.

The complete syntax for the APPLET tag is:

    '<' 'APPLET'
      ['CODEBASE' '=' codebaseURL]
      'CODE' '=' appletFile
      ['ALT' '=' alternateText]
      ['NAME' '=' appletInstanceName]
      'WIDTH' '=' pixels 'HEIGHT' '=' pixels
      ['ALIGN' '=' alignment]
      ['VSPACE' '=' pixels] ['HSPACE' '=' pixels]
    ['<' 'PARAM' 'NAME' '=' appletAttribute1 'VALUE' '=' value '>']
    ['<' 'PARAM' 'NAME' '=' appletAttribute2 'VALUE' '=' value '>']
    . . .
'CODEBASE' '=' codebaseURL
    This optional attribute specifies the base URL of the applet -- the directory that contains the applet's code. If this attribute is not specified, then the document's URL is used.
'CODE' '=' appletFile
    This required attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URL of the applet. It cannot be absolute.
'ALT' '=' alternateText
    This optional attribute specifies any text that should be displayed if the browser understands the APPLET tag but can't run Java applets.
'NAME' '=' appletInstanceName
    This optional attribute specifies a name for the applet instance, which makes it possible for applets on the same page to find (and communicate with) each other.
'WIDTH' '=' pixels 'HEIGHT' '=' pixels
    These required attributes give the initial width and height (in pixels) of the applet display area, not counting any windows or dialogs that the applet brings up.
'ALIGN' '=' alignment
    This required attribute specifies the alignment of the applet. The possible values of this attribute are the same as those for the IMG tag: left, right, top, texttop, middle, absmiddle, baseline, bottom, absbottom.
'VSPACE' '=' pixels 'HSPACE' '=' pixels
    These option attributes specify the number of pixels above and below the applet (VSPACE) and on each side of the applet (HSPACE). They're treated the same way as the IMG tag's VSPACE and HSPACE attributes.
'<' 'PARAM' 'NAME' '=' appletAttribute1 'VALUE' '=' value '>' . . .
    This tag is the only way to specify an applet-specific attribute. Applets access their attributes with the getParameter() method.

Copyright © 1997 - Grafman Productions - ALL RIGHTS RESERVED
For comments/correction/additions regarding this reference, email

Grafman Productions