ImageButtonX applet


Download latest version
Two button example
The upper button is an animated gif

Design goal:
- A panel with several buttons.
- These buttons should support animated gifs and transparent gifs.
- The layout of the buttons is done manually.
- Support of a background image and color.
- Support of html frames with a separate tag.
- Sound option on mouse over and mouse down.
- A retry loop when the server times out when loading images.

Note: you must set <PARAM NAME="offscreen_mode" VALUE="true">
To false when you use animated gifs.
Animated gifs haven't jet been tested with this applet.

CopyRight:
If you add a link to http://www.comweb.nl on the page then it's free to use.
Free to distribute in unchanged form.

Disclaimer:
The use is at own risk.

Bugs :
1: Netscape 4.72 and probably other versions.
They do not correcty use their cashing mechanisme.
Wrong implementation of the http protocol in their Java Virtual Machine.
This causes them not to load the animated gifs on some servers.
Tested on NT 4.0 SP6

Support:
If there is time left but we would appreciate if you reported any bugs.
http://alpha.comweb.nl/others/debugForm.html

Installation:
1: insert the applet tags in your html page.
2: upload all the needed files to your provider's server.
{ ImgButonX.class, Glypher.class, ImgButonX.cab , your html page , sound files , image files}.
3: test the applet and look at the browsers Java console.
You should enable this on Ms Explorer
tools/internetoptions,advanced,enable java console requires a restart.

Applet tags:
Here is an overview first:
<APPLET CODE="ImgButonX.class" WIDTH="200" HEIGHT="300">
<PARAM NAME="CABBASE" VALUE="ImgButonX.cab">
<PARAM NAME="bgcolor" VALUE="#FFFF00">
<PARAM NAME="background" VALUE="back.gif">
<PARAM NAME="offscreen_mode" VALUE="true">
<PARAM NAME="button1" VALUE="50| 25|email.gif|email2.gif|img3.gif|over.au|down.au|mailto:sales@comweb.nl|null">
<PARAM NAME="button2" VALUE="50|175|img4.gif|img5.gif|img6.gif|over.au|down.au|http://www.comweb.nl|_top">
</APPLET>


<APPLET CODE="ImgButonX.class" WIDTH="200" HEIGHT="300">
The applet starting tag.
Note this applet expects the pictures and sound files relative to the applet class file.
I suggest not to use the codebase attribute.

<PARAM NAME="CABBASE" VALUE="ImgButonX.cab">
This one is only red by Ms Explorer.
A cab file is an archive file like zip.
Here it contains only the applet class files.
It's also possible to place all images and sound files in the cab.
This way the applet will load a lot faster.
This makes it less sensitive for server time outs.

<PARAM NAME="bgcolor" VALUE="#FFFF00">
Doesn't support color names because there are too many.
It's a hexadecimal RGB presentation of the color.
It always starts with a # sign.
Hexadecimal color representation is also used with the bgcolor attribute of the body tag.

<PARAM NAME="background" VALUE="back.gif">
A background picture.
Note the applet does not tile the background picture.
It should have at least the size of the applet.
Applets do support gif and jpg pictures.

<PARAM NAME="offscreen_mode" VALUE="true">
When you don't use animated gifs omit this tag or set it to true.
This will reduce the flickering of the applet.
If you use animated gifs set it to false.
I hope it works but animated gifs are sometimes problematic with applets.

<PARAM NAME="button1" VALUE="50| 25|email.gif|email2.gif|img3.gif|over.au|down.au|mailto:sales@comweb.nl|null">
<PARAM NAME="button2" VALUE="50|175|img4.gif|img5.gif|img6.gif|over.au|down.au|http://www.comweb.nl|_top">

Here is an example on how buttons are added.
General syntax
x | y | upImage | overImage | downImage | overSound | downSound | URL | htmlTarget
The upper left image of the applet is coordinate 0,0.
x,y points to the upper left corner of the button.
Assumed is that all images of each button are the same size.
Applets do only support uLaw 8000 kHz unsigned sound files.
A good program to create them is see goldwave.com
URL is the link that the button uses.
HtmlTarget is the frame name.
So don't add the target directly at the url.
All components here are split up using the | sign.
If you don't use a particular item insert null.
Example: <PARAM NAME="button2" VALUE="50|175|img4.gif|img5.gif|img6.gif|null|null|http://www.comweb.nl|null">
In this case the applet will not play any sounds.

</APPLET>
Applet ending tag.

Added on Januari 24 2001
<PARAM NAME="button2_offscreen_mode" VALUE="false">
This makes it also possible to set offscreen Image use for each button seperatly.

Note of the author:
Current status of this applet is beta.
Anyway I think it does work.

Rob,
sales@comweb.nl