ModernJava
http://www.modernminds.com
S ite Menu Button Bar

This example of the LiteTextURLButtonBar applet shows you how to create a button bar that provides a menu of links to World Wide Web sites.

Notice that the text and the text color change when the mouse is moved over a button and when the button is clicked. Also, notice how the buttons are not edge-to-edge, and that the behavior of the button borders is somewhat unconventional.

Warning: unlike the other applet classes in the Ultimate Button BarTM package, LiteTextURLButtonBar does not provide a parameter to allow buttons to exist with an invalid URL. If you click on a button, the applet will attempt to load the page indicated by the button over the Internet.
If the Java class 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="LiteTextURLButtonBar.class" WIDTH="260" HEIGHT="66">
<PARAM NAME="orient" VALUE="v">
<PARAM NAME="buttonBorders" VALUE="base">
<PARAM NAME="borderSize" VALUE="2">
<PARAM NAME="borderIntensity" VALUE="35">
<PARAM NAME="color" VALUE="7D3B9D">
<PARAM NAME="font" VALUE="TimesRoman">
<PARAM NAME="fontColor" VALUE="FFFFFF">
<PARAM NAME="fontColorOver" VALUE="FFFF00">
<PARAM NAME="fontColorDown" VALUE="00FF00"">
<PARAM NAME="fontSize" VALUE="16">
<PARAM NAME="button1Text" VALUE="Go to the Gamelan Site">
<PARAM NAME="button1TextOver" VALUE="Gamelan: The Official Java Directory">
<PARAM NAME="button1TextDown" VALUE="Jumping to the Gamelan Site...">
<PARAM NAME="button1Start" VALUE="0">
<PARAM NAME="button1Size" VALUE="20">
<PARAM NAME="button1URL" VALUE="http://www.gamelan.com/">
<PARAM NAME="button2Text" VALUE="Go to the JARS Site">
<PARAM NAME="button2TextOver" VALUE="JARS: The Java Applet Rating Service">
<PARAM NAME="button2TextDown" VALUE="Jumping to JARS...">
<PARAM NAME="button2Start" VALUE="23">
<PARAM NAME="button2Size" VALUE="20">
<PARAM NAME="button2URL" VALUE="http://www.jars.com/">
<PARAM NAME="button3Text" VALUE="Java Announcement Archives">
<PARAM NAME="button3TextOver" VALUE="Announcements Related to Java">
<PARAM NAME="button3TextDown" VALUE="Jumping to the Archives...">
<PARAM NAME="button3Start" VALUE="46">
<PARAM NAME="button3Size" VALUE="20">
<PARAM NAME="button3URL" VALUE="http://wuarchive.wustl.edu/packages/java/">
</APPLET>
N otes on the Applet 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 borderIntensity was decreased to 35% (the default is 50%) in order to soften the button borders a bit.
The buttonBorders parameter was used to draw borders only around the base buttons (a parameter value of "base"). This looks better than drawing borders for all button states when the buttons are spaced slightly apart. Alternatively, the parameter value could have been specified as "other" which would cause borders to "pop-up" when the mouse was moved over a button.
Copyright © 1997 by Modern Minds, Inc.