| BUTTON Author: Eric Harshbarger |
|
Download... The Zipfile includes Classfile, Source code and instructions. 11.6Kb |
This applet displays a button with three distinct states: BASE, ENTER, and CLICK. For each state a background color, foreground color, image, and text message may be defined. Additionally, sound files may be played during the ENTER and CLICK states. A URL (and TARGET) may be defined to spawn a new webpage when the button is clicked.
The Java classes needed to implemet this applet are:
Button1.class
CoolTool3.class
Parameters
The param tags are the lines of HTML which customize the applet to your needs. Following is a list of all the parameter options which are currently applicable. Be sure to use double-quotes around the parameter's value if the value contains any whitespace. Most parameters have defaults in case you choose not to specify them... but some parameters must be included.
COPYRIGHT: This parameter MUST be included and MUST have a value of:
"Button applet, Copyright 1997 Sun Microsystems, Inc., all rights reserved."
DOCUMENTATION: This parameter MUST be included and MUST have a value of:
"Documentation found at: http://www.xm.com/cafe/"
BASE.BGCOLOR: This parameter indicates the background color of the applet while the mouse pointer is outside of the applet's area.
BASE.FGCOLOR: This parameter indicates the foreground color of the applet (the color of the text) while the mouse pointer is outside of the applet's area.
BASE.FONTNAME: This parameter indicates font face used for the text while the mouse pointer is outside of the applet's area.
BASE.FONTSIZE: This parameter indicates font size used for the text while the mouse pointer is outside of the applet's area.
BASE.FONTSTYLE: This parameter indicates font style used for the text while the mouse pointer is outside of the applet's area.
BASE.IMAGE: This parameter indicates the path to an image file which is to be displayed in the button (behind the BASE.TEXT) while the mouse pointer is outside of the applet's area.
After the path of the image file is indicated, x and y coordinates of the images upper-left corner may be specified in the parameter's value by following the path name with pipe, x-value, pipe, y-value (e.g. value="pathname | x | y"). The default for x and y is 0.
BASE.TEXT: This parameter indicates message to be displayed in the buttons area (using the appropriate font information). Line breaks in the message may be forced with a backslash (\) character. The x and y coordinates of the baseline of the first line of the message may be specified following the message by pipe, x-value, pipe, y-value (e.g. value="message | x | y"). The default for the x value is 0, while y's default value is equal to the font's height.
There are parameters for ENTER.BGCOLOR, ENTER.FGCOLOR,... CLICK.BGCOLOR, CLICK.FGCOLOR... as well, which behave as the parameters above but are used for the other states of the applet (ENTER when the mouse pointer is inside the applet area, CLICK when the applet is mouse-clicked upon). If the parameters are not used, the ENTER-values default to the corresponding BASE-values, while the CLICK-values default to the corresponding ENTER-values.
ENTER.SOUND: A sound file played when the applet area is entered.
CLICK.SOUND: A sound file played when the applet area is mouse-clicked.
HIGHLIGHT: If 'true', the rectangle of color drawn for the button is given a 'raised' look in the BASE/ENTER states, and a 'depressed' look in the CLICK state. The default is 'false', no highlighting.
URL: A URL indicating what webpage should be spawned when the button is clicked.
TARGET: The name of the web-browser frame in which the URL (above) is shown.
The Button applet may be used freely by anyone. Neither Sun Microsystems, Inc. nor Eric C. Harshbarger is responsible for any problems resulting from the malfunction, use, or misuse of this applet.