 
 |
|
 |
sing
CAB and ZIP Files
Included with
the Ultimate Button BarTMJava
class files are a number of files with the extension "cab" or "zip".
These files can be used to shorten the time it takes a browser to load the Java
class files.
|
|
 |
AB Files
CAB
files (short for CABinet files) are files that store multiple Java class files
in a compressed format in a single file. You indicate to a browser that a CAB
file is available by using the CABBASE parameter in the applet
tag. When a browser that supports CAB files sees the CABBASE
parameter, the browser will load the single CAB file instead of loading each
Java class file separately. This improves the load time in two ways: first, only
one network connection must be made (as opposed to one network connection for
each class file), and second, since the class files are compressed, there is
less data that must be transferred over the network.
The CAB format was
developed by Microsoft, and Internet Explorer version 3.0 or higher supports the
CABBASE parameter.
To use a CAB file, include the CABBASE
parameter in the
APPLET HTML tag. For example:
<APPLET CODEBASE="../../../Java" CODE="LiteTextURLButtonBar.class"
WIDTH="376" HEIGHT="32">
<PARAM NAME="cabbase"
VALUE="ButtonBarAll.cab">
[ ... rest of applet parameters follow... ]
</APPLET>
|
The regular Java class files should be stored
along with the CAB file so that browsers that support Java but that do not
support CAB files will still be able to run the Java applet. |
|
 |
IP Files
A
ZIP file contains multiple Java class files, but in an uncompressed
format. You indicate to a browser that a ZIP file is available by using the
ARCHIVE parameter in the applet tag. When a browser that supports
ZIP files sees the ARCHIVE parameter, the browser will load the
single ZIP file instead of loading each Java class file separately. Using a ZIP
file improves the load time because only one network connection must be made (as
opposed to one network connection for each class file).
Note that a ZIP
file behaves differently than a CAB file in that if the browser cannot find a
Java class file in the ZIP file, it will search for the Java class file in the
traditional manner. If a CAB file is used, then all Java classes that
the applet uses must be found in the CAB file, or the applet will not
run.
ZIP files are supported by Netscape Navigator version 3.0 or
higher.
To use a ZIP file, include the ARCHIVE parameter
in the APPLET HTML tag. For example:
<APPLET CODEBASE="../../../Java" CODE="LiteTextURLButtonBar.class"
WIDTH="376" HEIGHT="32">
<PARAM NAME="archive"
VALUE="ButtonBarAll.zip">
[ ... rest of applet
parameters follow... ]
</APPLET>
|
The regular Java class files should be stored
along with the ZIP file so that browsers that support Java but that do not
support ZIP files will still be able to run the Java applet. |
|
 |
sing
CAB and ZIP Files Together
You
can include both the CABBASE and the ARCHIVE
parameter in the applet tag. This will allow browsers that support either a CAB
file or a ZIP file to optimize the loading of Java classes.
Below is an
example of using both parameters:
<APPLET
CODEBASE="../../../Java" CODE="LiteTextURLButtonBar.class"
WIDTH="376" HEIGHT="32">
<PARAM NAME="cabbase"
VALUE="ButtonBarAll.cab">
<PARAM NAME="archive"
VALUE="ButtonBarAll.zip">
[ ... rest of applet
parameters follow... ]
</APPLET>
|
Be sure to include the regular Java class files
with the CAB file and the ZIP file so that browsers that support Java but that
do not support a CAB or a ZIP file will still be able to run the Java applet. |
|
 |
ontents
of the CAB and ZIP Files
The
following is a breakdown of what Java classes are included in each of the
included CAB and ZIP files.
You should only need one CAB and one ZIP
file for all of the button bars on your web site. Choose the pair that contains
only the functionality that you will use. For instance, if you will use only
image based button bars, then pick ButtonBarImg.cab and ButtonBarImg.zip.
If you will use image based button bars and simple text based button bars, then
choose ButtonBarImgLTxt.cab and ButtonBarImgLTxt.zip.
Note
that the CABBASE and ARCHIVE parameters will always
point to the same CAB or ZIP file. If you are using ButtonBarImgLTxt.cab
and ButtonBarImgLTxt.zip, then you would set the CODE
parameter of the APPLET tag to the particular class that the
button bar actually uses (e.g., ImageURLButtonBar.class or LiteTextURLButtonBar.class).
ButtonBarImg.cab ButtonBarImg.zip |
ButtonBar.class ButtonBarObserver.class ButtonRegion.class ButtonAnimate.class ImageURLButtonBar.class |
ButtonBarImgTxt.cab ButtonBarImgTxt.zip |
ButtonBar.class ButtonBarObserver.class ButtonRegion.class ButtonAnimate.class ImageURLButtonBar.class TextURLButtonBar.class |
ButtonBarImgLTxt.cab ButtonBarImgLTxt.zip |
ButtonBar.class ButtonBarObserver.class ButtonRegion.class ButtonAnimate.class ImageURLButtonBar.class LiteTextURLButtonBar.class |
ButtonBarTxt.cab ButtonBarTxt.zip |
ButtonBar.class ButtonBarObserver.class ButtonRegion.class ButtonAnimate.class TextURLButtonBar.class |
ButtonBarLTxt.cab ButtonBarLTxt.zip |
ButtonBar.class ButtonBarObserver.class ButtonRegion.class ButtonAnimate.class LiteTextURLButtonBar.class |
ButtonBarAll.cab ButtonBarAll.zip |
ButtonBar.class ButtonBarObserver.class ButtonRegion.class ButtonAnimate.class ImageURLButtonBar.class TextURLButtonBar.class LiteTextURLButtonBar.class | |
|
| Copyright ©
1997 by Modern Minds, Inc. |