<< Home] [Index] [Guide] [Next >>


Basic Applet Parameters


Applets (developed with the Java computer language created by Sun Microsystems) are embedded within the HTML script of a web page as an <applet>...</applet> tag. There are a number of attributes you can specify as part of applet tags that are defined within HTML, and a number of parameters you can specify within the two tags which are used in ChView. Although the following exposition is not intended to be a complete reference to the variety of parameters that HTML defines for <applet>, it covers the basic ones useful in ChView.

code

This is pretty much a required tag. It is the Java class file that is executed to run the applet. For ChView applets, this will always be chview.ChViewer. So you would write something like:

<applet 
code="chview.ChViewer"> 
... 
</applet>

archive

In reality, the actual code for ChView is spread amongst innumerable .class files, which would be a pain to deploy. Fortunately, Java allows those files to be all wrapped up in a single Java Archive file, better known as a "jar" file. (For those interested in etymology, jar, java-archive, derives from "tar", tape-archview, a Unix command now used for much more than archiving tapes.) A Jar file is just like a ZIP file and so you can use PKZIP or WINZIP to view it.

ChView is distributed in a jar file called chview.jar. (It pays not to be imaginative in such things.) This is specified to the archive parameter, like so:

<applet 
archive="chview.jar"> 
... 
</applet>

Another equivalent was is using a cab file, which you would specify with a cabinets attribute. However, because Microsoft invented this, cab files only work for Internet Explorer, and so we are only distributing ChView as a jar file ("chview.jar"). (It does, of course, beg the question: "Why did Microsoft bother doing something just the same?", but that is beyond the scope of this documentation, and we'll leave it up to the judical inquiries.

id

This gives a program identifier to the applet that allows it to be used from JavaScript. Presently there aren't any useful tie-ins to JavaScript. But you think of any, let us know, and we'll see what we can do.

Using id can also enable the applet to be used from VBScript, which is something else Microsoft invented that only works in Internet Explorer, and which is functionally equivalent to JavaScript. Again, this is why ChView more generally implements JavaScript.

Normally, we assign "ChViewer" to id like this:

<applet 
id="ChViewer">
...
</applet>

align

This describes what part of the applet to align on, for example: "left", "right", "bottom" and other fairly obvious options are available. Normally, ChView is assigned to "middle" this, like this:

<applet 
align="middle"> 
...
</applet>

width, height

This describes the amount of physical space the applet will take up, so that ChView will scale to whatever size you give it. Hence, you can have a big spread for a full page, or a long thin one for a navagational bar.

<applet 
height="440" 
width="440">
...
</applet>

Wrapping it all up

So, all put together, your basic applet ends up looking something like this in HTML:

<applet
 code="chview.ChViewer"
 archive="chview.jar"
 id="ChViewer"
 align="middle"
 width="640" height="160">
 ...
 </applet>

And renders like:


If you can read this, your browser can't display ChView


Note how there isn't actually anything in view. That's because we haven't added any data yet. We'll cover that in the next section on Adding Stars.


<< Home] [Index] [Guide] [Next >>


© 1998-2001 Sol Company. All Rights Reserved. Any other trademarks appearing on this website are the property of their respective owners. Unless explicitly stated, SolStation.com and the Sol Company do not imply any business relationship with Earth-based institutions.