ModernJava
http://www.modernminds.com
T ext Button Bar with Background

This example of the TextURLButtonBar applet demonstrates the use of a background image file as well as how font and text attributes can be overridden for buttons.

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).

Notice that the button text changes as the mouse is moved over a button, and also that the text in the browser's status bar changes.
A background JPEG image is used to delineate the button area with a raised frame, and the color of the text for each button is graduated to convey to the user that the buttons in the button bar are arranged in a hierarchical fashion.

The background image is displayed below:

BarBackground.JPG

If the Java class files and the image file is 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="TextURLButtonBar.class" WIDTH="350" HEIGHT="100">
<PARAM NAME="disableBadURL" VALUE="false">
<PARAM NAME="background" VALUE="BarBackground.JPG">
<PARAM NAME="orient" VALUE="v">
<PARAM NAME="barWidth" VALUE="300">
<PARAM NAME="barHeight" VALUE="66">
<PARAM NAME="barXPos" VALUE="25">
<PARAM NAME="barYPos" VALUE="17">
<PARAM NAME="drawGrayBase" VALUE="false">
<PARAM NAME="color" VALUE="362B6C">
<PARAM NAME="fontColorOver" VALUE="FFFF00">
<PARAM NAME="fontColorDown" VALUE="00FF00">
<PARAM NAME="align" VALUE="left">
<PARAM NAME="fontSize" VALUE="16">
<PARAM NAME="fontStyle" VALUE="bold">
<PARAM NAME="button1Text" VALUE="Jump to Start of Current Topic">
<PARAM NAME="button1TextOver" VALUE='Topic C: "How to Add a Topic"'>
<PARAM NAME="button1Start" VALUE="0">
<PARAM NAME="button1Size" VALUE="22">
<PARAM NAME="button1Desc" VALUE="Topic Top">
<PARAM NAME="button1FontColor" VALUE="FCD1F9">
<PARAM NAME="button2Text" VALUE="Jump to Start of Current Section">
<PARAM NAME="button2TextOver" VALUE='Section V: "How to Delete a Section"'>
<PARAM NAME="button2Start" VALUE="22">
<PARAM NAME="button2Size" VALUE="22">
<PARAM NAME="button2Desc" VALUE="Section Top">
<PARAM NAME="button2FontColor" VALUE="F997F1">
<PARAM NAME="button3Text" VALUE="Jump to Start of Current Chapter">
<PARAM NAME="button3TextOver" VALUE='Chapter 1: "Creating a Chapter"'>
<PARAM NAME="button3Start" VALUE="44">
<PARAM NAME="button3Size" VALUE="22">
<PARAM NAME="button3Desc" VALUE="Chapter Top">
<PARAM NAME="button3FontColor" VALUE="F567EB">
</APPLET>
N otes on the Applet Parameters
The height and width values in the applet tag correspond to the height and width of background image (BarBackground.JPG). The height, width, and position (top-left corner) of the button bar is manually set using the barWidth, barHeight, barXPos, and barYPos parameters.
Based on the applet's dimensions, the applet will assume that the button bar has a horizontal orientation. The orient parameter must be used to tell the applet that the button bar is oriented vertically.
The drawGrayBase parameter must be set to "false" so that the applet does not create a grayscale base image.
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.