The Parameters Explained             

Each of TreeView's parameters is explained below, with reference to the clickable example code in the left frame: you can click a parameter from the example code to jump to its explanation, or simply read this page from top to toe. As you read, click the red references to other parameters to jump to them.

Most of TreeView's parameters have a default setting which is mentioned below. If the default setting is the option you'd like to use in your own implementation, you can leave that parameter out of your HTML code.


The 'Archive' attribute & 'CabBase' parameter
JAR (Java ARchive) and CAB (cabinet) files are archives containing Java class files in compressed form, making them easier to handle and quicker to download. Most modern browsers are able to read one or other of these formats, and the Archive attribute and CabBase parameter tell the browser the name of the archive file to open. The .JAR, .CAB and .CLASS files must all be in the same directory, and the CODEBASE= attribute is used in the normal way, if required, specifying the absolute or relative location of this directory. Older browsers that are unable to read either the JAR or the CAB file will instead read the loose CLASS files.

Applet Width & Height
WIDTH: You'll usually want to make the applet as narrow as you can (to save page space!), but check that the text beside all your folders and pages on the menu isn't being cut off. Browsers tend to vary a little in their spacing of text in Java applets. To be safe, check your pages in Netscape which applies rather more space to a line of text than Internet Explorer, or visitors to your page that use Netscape might be missing a view characters on the longer labels.

HEIGHT: Once again, you'll want to make this as short as possible. Since only one folder will ever be open at a time, judge the height of the applet relative to what the applet looks like when you open the folder containing the most pages.

Quick Tip: When setting up the applet dimensions, it's far easier if you use the BgColor parameter to temporarily set the applet background to a color that stands out from your page background. When you've reduced the dimensions as much as you can, return the BgColor setting to the color you wanted.

Copyright
This parameter must be included or the applet will not run, whether registered or unregistered. To prevent mistakes we recommend that you copy/paste it into your code from the Getting Started page: it is case-sensitive, single-spaced throughout and should appear on a single line. If there's a problem with this parameter, you'll see a status-bar message that reads "Copyright parameter missing or incorrect" which should lead you to the problem.

BgColor
The applet's background color as a hex triplet. For best results, set this to the same value as that of your page's body-background. The default is FFFFFF (white).

BgImage
The name (and location if necessary) an optional JPEG or GIF background image for the applet, which is placed over your chosen BgColor and behind the menu itself. The image is automatically scaled to match the applet dimensions, so it's preferable to choose or create an image that matches these dimensions fairly closely. If you use a GIF image containing transparency, the transparent color will be replaced by your chosen BgColor. The applet expects to find this image in the directory containing the current HTML file; if the image file is elsewhere, specify the location either as a relative or an absolute URL, in the same way that you use the HTML <IMG SRC=""> tag.

OutlineImage
The location (if necessary) and name of the GIF image to be used for the 'outline' symbols - the folder and page icons, pluses, minuses and dots that form the tree structure. Each set of images is contained in a single GIF file, and 6 of these files are included with TreeView: darkimg.gif, lightimg.gif, altdarkimg.gif, altlightimg.gif, newdarkimg.gif and newlightimg.gif. The applet expects to find this image in the same directory as the current HTML document, so if you place the chosen image elsewhere you'll need to specify its location as well as its name, in the form of an absolute or relative URL. If this parameter is missing, or the image file cannot be found, the applet will still run, but (of course) no outline images will be shown.

FolderFont
A comma-delimited string giving the name, style and size of the font you want to use for all folder labels. The default settings are Helvetica, in bold, at size 11, which would be written as Helvetica,bold,11. Two important things to note: first, there must be no spaces in this entry; second, the three items must appear in the order name,style,size. Note that the style part of this setting can be plain, bold, italic or bolditalic, and these are not case-sensitive.

FolderColor
A hex triplet for the color of a folder's label when unfocussed (the mouse isn't over it). The default is 000000 (black).

FolderFocusColor
The color of a folder label when focussed (the mouse is over it). The default is 0000FF (blue).

FolderPressColor
The color of a folder label when the mouse button is clicked over it. The default is FF0000 (red).

PageFont
Another comma-delimited string giving the name, style and size of the font you want to use for all page labels. The default settings are Dialog, in plain, at size 10, which would be written as Dialog,plain,10. The details for this parameter are otherwise the same as those for the FolderFont above.

PageColor
A hex triplet for the color of a page's label when unfocussed (the mouse isn't over it). The default is 000000 (black).

PageFocusColor
The color of a page label when focussed (the mouse is over it). The default is 0000FF (blue).

PagePressColor
The color of a page's label when depressed (clicked, not sad). The default is FF0000 (red).

DefaultTarget
HTML offers it's own range of recognized targets for links: _top, _self, _blank and _parent. But when you use an applet like TreeView that can take countless links, you'll often be opening your pages into a main frame in your browser, perhaps called 'Main', so almost every entry on the menu will need a Target parameter with the value "Main". The DefaultTarget parameter gives you a way to avoid entering all those parameters. Just enter the name of this main frame in the DefaultTarget parameter and it will be used by default for any Page (or linking Folder) on your menu that doesn't have its own individual Target parameter to override it.

The default setting for this parameter is _top, so if you leave this parameter out, any link that doesn't have its own Target parameter will open its document full-screen in the current window.

LeftIndent
This parameter allows the entire tree structure to be shifted away from the left edge of the applet by a specified number of pixels. The default is 0, for compatibility with previous versions. This indent setting doesn't affect any part of the header, but you can use the HeaderOffset to move the tree downwards if you need to. The LeftIndent parameter will accept a negative value (such as value="-5") if ylou want to move the menu entries further to the left.

UseHandCursor
A yes or no parameter that determines whether or not a typical 'web-style' hand cursor is used when the mouse moves over an entry on the menu. The default value is yes, so you need include this parameter only if you want to set it to 'no' and stick to the default pointer. This feature is applied only when an applet is running in a Java 1.1-compatible browser (Internet Explorer 4x or higher, Netscape Navigator 4.07 or higher). In other browsers, this parameter is ignored and the default pointer will be used.

Sound
Specifies whether or not you'd like the applet to play sounds in response to mouse-clicks. The value can be either yes or no, and neither is case-sensitive. (The default value is no.) If you want to use sounds, note that you must direct the applet to at least one Sun/NeXT format (.au) audio file using any or all of the three following parameters.

OpenSound
The path (if necessary) and name of the audio file to be played when a folder is opened. See Using Sounds, below. Paths to audio files are specified as URLs and may be either absolute or relative to the location of the current HTML page.

CloseSound
The path (if necessary) and name of the audio file to be played when the currently-open folder is closed (this sound isn't played when the folder is closed by clicking a different folder to open it). See Using Sounds, below.

LinkSound
The path (if necessary) and name of the audio file to be played when a link is clicked. As well as pages, this also applies to any folders that are set to act as links rather than as containers for pages. See Using Sounds, below.

Using Sounds: TreeView is very forgiving in its sound support. If Sound is set to 'yes' but none of the three parameters above is included (or you forgot to upload the audio files!) TreeView will still work properly, albeit silently. Therefore, if you only wish to have audio accompaniment for links (for example), simply remove the OpenSound/CloseSound parameters.
The following seven parameters, all of which have the word 'header' as a prefix, are very optional indeed. They allow you to place an image, or a menu-heading, or both, at the top of the menu, and to move all the menu's folders and pages downwards to make room.

Header
The text to appear as the label for the header. If you don't include this parameter, no header label will appear. The label will be vertically aligned within the center of the area you define as the HeaderOffset.

HeaderImage
The name (and location, if necessary) of an image to display in the header, which the applet expects to find in the same folder as the current HTML document. As usual, the location of the image, if different, should be given as a relative or absolute URL. The image is placed at the left edge of the applet, and is vertically aligned within the center of the area you define as the HeaderOffset.

HeaderFont
Yet another comma-delimited string that specifies the font to be used for the Header's label. The default value is Helvetica,bold,13. The details for this parameter are the same as those for the FolderFont and PageFont mentioned above.

HeaderColor
The color of the header label's text. The default is 000000 (black).

Header3D
An optional 3D text-effect to apply to the header label. There are four possible settings for this value, none of which is case-sensitive:

light Creates a 3D effect by deriving a lighter shade of the text color you chose in the HeaderColor parameter.

dark Creates a 3D effect by deriving a darker shade of the text color you chose in the HeaderColor parameter.

gray Creates a 3D effect using gray shades and ignoring the color of the text label chosen in the HeaderColor parameter.

off No 3D effect. This is the default setting.

The theory behind the choice of three different 'on' settings is that you should be able to find a setting that looks good whatever your choice of BgColor/BgImage and HeaderColor settings. It's a case of experimentation. If you stick with the default settings of a white background and black header color, the gray setting works best, and will probably be the most reliable choice in most situations. Bear in mind that if your HeaderColor already uses shades set at maximum (such as FF0000 for full-on red), the light setting applied to this will just tend to blur the text - it will be exactly the same color since it can't brighten the red any more.

If you haven't included the Header parameter to place a label in the header, it doesn't matter what this parameter is set at, it'll be ignored.

HeaderOffset
The value for this parameter is an integer, with a default of 0. If you include a Header label and/or HeaderImage using the parameters above, they'll appear over the top of the first menu entry or entries. This parameter shifts the menu itself downwards to create a space for the image/label. If your image is 20 pixels high, for example, you'd want to enter a value of at least 20 for this parameter to prevent it overlapping your first folder.

Both the image and the header label are automatically vertically aligned within the center of the area you define in this parameter. In other words, as you increase the value of the offset, the menu will move downwards, and the image and header label move upwards so that the space above and below them increases.

Note that this parameter takes effect whether or not you've included the Header and/or HeaderImage parameters. So you can use it to create blank space above your menu, which can be useful in placing the tree where you want it to be when using a BgImage. If you do use this parameter, remember that you'll also need to increase the height of your applet to allow for the extra space it now takes.

HeaderIndent
This parameter also takes an integer as its value, with a default of 0. When you include the Header parameter to specify a heading label for the menu, that label will be aligned to the left edge of the applet. You can use the HeaderIndent parameter to move the label further to the right. You might do this for aesthetic reasons (you want the label centered, for example). More practically, if you're including a HeaderImage as well, you might want the label to appear to its right rather than over the top of it, or you might want the text to begin at a precise point on top of the image to create some weird and wonderful effect. It's worth noting that if you haven't included the Header parameter to place a label in the header, it doesn't matter what this parameter is set at, it'll be ignored.

Folder1, Folder2, . . . Foldern
The labels for each of the folders you want to display. TreeView can display an unlimited quantity of folders, but they MUST be numbered sequentially. If your applet code doesn't contain a parameter named Folder5, for example, the applet will assume that there isn't a Folder6, 7, 8, etc either, and won't look any further.

Message1, Message2, . . . Messagen
Optional text messages to display in the browser's statusbar when the mouse passes over the correspondingly-numbered folder. If no Message parameter is included for a folder, no statusbar message will be displayed when the mouse passes over that folder. A message can be displayed for a folder regardless of whether the folder acts as a container or as a link.

URL1a, URL2a, . . . URLna
An optional absolute or relative URL to which the correspondingly-numbered Folder should link when clicked. If the applet finds a URLna parameter for a particular folder, it will regard that folder as a link. Thus, no 'plus' icon will be displayed beside it, and any parameters relating to Pages for that folder will be ignored.

Like Pages, a Folder can link to up to four URLs when clicked, bringing the b, c and d suffixes into play. As an example, if you wanted your second folder to link to four URLs, you'd include parameters named URL2a, URL2b, URL2c and URL2d. For more details about multiple links, see below.

As an aid to testing, you can prefix your URLs with a dollar sign ($). You can then click the applet without error messages appearing or being linked elsewhere.

Target1a, Target2a, . . . Targetna
If a folder is to act as a link rather than a container, by including one or more URL parameters for it, this parameter lets you set the target frame or window names into which those URLs should open. The number following the word 'Target' corresponds to the Folder number, and the letter suffix (a, b, c or d) to the four possible URLs that can be fetched. So if the 'c' link for your second folder (which you specified in the URL2c parameter) is to open in a frame called 'rightframe', you'd include the parameter param name=Target2c value="rightframe".

If a URL parameter exists for a folder and has no corresponding Target parameter, the target used will be the DefaultTarget.

For the remaining parameters, which relate to the Pages contained within Folders, examples given below assume that the Pages are in Folder1 and therefore have a 1- prefix. To add Pages to Folder2, change this prefix to 2-, to add Pages to Folder3, change the prefix to 3-, and so on.

1-Page1, 1-Page2, . . . 1-Pagen
The label to appear beside the corresponding page icon. A folder can contain an unlimited quantity of Pages, but they MUST be numbered sequentially. If your applet code doesn't contain a parameter named 1-Page5, for example, the applet will assume that Folder1 contains only four Pages and won't bother looking to see if you included a 1-Page6 parameter.

1-URL1a, 1-URL2a, . . . 1-URLna
The URL to which each Page should link when clicked. As with the URL parameters for linking folders, the number following the word 'URL' refers to the Page number.

Also like linking folders, a Page can link to up to four URLs. Most of the time you'll only need a page to link to a single URL, so most of these parameters will use the 'a' suffix only. But if, for example, you needed Folder1 Page6 to link to three URLs, you'd include the parameters 1-URL6a, 1-URL6b and 1-URL6c.

There are two points to bear in mind about using multiple URLs. First, the URLs will be fetched one at a time (although they should appear almost simultaneous) in the abcd order. This leads to the second point: if one of those URLs will load a page over the top of the applet, the applet must stop running. Therefore, if you're trying to load 4 pages, using all four URL parameters, and your 1-URL2b parameter is the one that loads over the applet, the 1-URL2c and 1-URL2d links won't work - the applet stops running before it can process the requests!

As an aid to testing, you can prefix your URLs with a dollar sign ($). You can then click the applet without error messages appearing or being linked elsewhere.

1-Target1a, 1-Target2a, . . . 1-Targetna
Allows you to specify a frame- or window-name into which each of the URL links should be opened. Once again, the number after 'Target' corresponds with a Page number, and the a,b,c,d suffixes correspond with the URL parameters. If a URL parameter exists and has no corresponding Target parameter, the target used will be the DefaultTarget.

Remember that frame names are case-sensitive. If you're trying to make something open in a frame and your browser persists in opening a new window for it instead, check that the case and spelling of the name match in the Target parameter and in your HTML <frameset> tag.

1-Message1, 1-Message2, . . . 1-Messagen
A text-string to be displayed in the browser's statusbar when the mouse passes over the corresonding Page, usually giving some clue to where the link will take you. Unless you enter this parameter, no statusbar text will be displayed for that page.


































.