ModernJava
http://www.modernminds.com
S ingle Image Button Bar

The simplest button bar that you can create with the ImageURLButtonBar applet is a button bar that uses just one image file.

The button bar below uses one image as the "base" button bar state and the applet creates the images for other button states automatically. Try moving your mouse over the buttons and clicking on the buttons (clicking on the buttons will not cause a URL to load in this example).
Since only the "base" image for the button bar was specified in the applet's parameter, the applet automatically created a grayscale version of the image and used the grayscale image as the button bar "base" image. The original "base" image was then used as the "mouseOver" image. The "mouseDown" image was automatically created by "brightening" the "mouseOver" image.

If the Java class files and the image files are located in the same directory as the HTML, then the complete applet tag would be defined as illustrated below. Click on the PARAM name for detailed information about the parameter.

<APPLET CODE="ImageURLButtonBar.class" WIDTH="350" HEIGHT="21">
<PARAM NAME="base" VALUE="DemoBar1.GIF">
<PARAM NAME="disableBadURL" VALUE="false">
<PARAM NAME="button1Start" VALUE="0">
<PARAM NAME="button1Size" VALUE="63">
<PARAM NAME="button2Start" VALUE="65">
<PARAM NAME="button2Size" VALUE="63">
<PARAM NAME="button3Start" VALUE="157">
<PARAM NAME="button3Size" VALUE="63">
<PARAM NAME="button4Start" VALUE="222">
<PARAM NAME="button4Size" VALUE="63">
<PARAM NAME="button5Start" VALUE="287">
<PARAM NAME="button5Size" VALUE="63">
</APPLET>

The user created base image for this button bar is shown below:


Button Bar Base Image: DemoBar1.GIF
otes on the Applet Parameters
The height and width values in the applet tag correspond to the height and width of the "base" image (DemoBar1.GIF).
Notice how the buttons do not have to be positioned edge-to-edge. The button start and button size parameters are used to layout the locations of buttons on the button bar.
The disableBadURL parameter is used so that you can click the buttons without having a page load over the example. Normally you would want to specify URLs for the buttons and omit the disableBadURL parameter.
Copyright © 1997 by Modern Minds, Inc.