ModernJava
http://www.modernminds.com
U RLImageButton (Version 1.01)

The URLImageButton applet is used in a web page to provide a link to another web page. When the URLImageButton is clicked, the target web page is loaded. The target web page can either replace the current web page, or can be loaded into a specified frame on the current web page.
O peration

When the URLImageButton is initialized, a user specified button image (buttonImage) is displayed.

When the mouse is moved over the URLImageButton, a "mouse over button" image (mouseOverImage), if specified, is displayed.

When the mouse is clicked on the URLImageButton, a "mouse clicked on button" image is displayed (mouseDownImage), if specified. If mouseDownImage is not specified, then a frame is drawn around the URLImageButton.

The mouseDownImage or the frame is displayed for as long as the mouse button is held down and the mouse is positioned over the URLImageButton.

When the mouse button is released over the URLImageButton, then the user specified URL (url) is loaded.

The applet has been programmed so that the URLImageButton will become functional as soon as buttonImage is loaded (the applet loads the optional mouseOverImage and mouseDownImage asynchronously).
S ample

If your browser supports Java, a functional sample of the URLImageButton applet appears below.


No Java Support Clicking the Sample button will cause this page to be reloaded.
P arameters

Following are the HTML parameters for the applet. A parameter marked "Opt" is optional, and a parameter marked "Req" is required.

Req buttonImage The file name of the GIF or JPEG image that is displayed when the mouse is not over the button.

The file path is based starting with the directory in which the HTML document is located.
Opt mouseOverImage The file name of the GIF or JPEG image that is displayed when the mouse is over the button.

This image is loaded asynchronously.

The file path is based starting with the directory in which the HTML document is located.
Opt mouseDownImage The file name of the GIF or JPEG image that is displayed when the mouse is clicked on the button.

If this parameter is not specified, then a frame will be drawn around the button instead.

This image is loaded asynchronously.

The file path is based starting with the directory in which the HTML document is located.
Opt frameColor This is the highlight color used to frame the button when the mouse is clicked on the button and when the mouseDownImage parameter is not specified or the image has not yet been loaded.

The value must be a hexadecimal RGB value. If instance "FF0000" would be red, and "888888" would be a medium gray.

The color defaults to white if not specified.
Req url The URL to display when the button is clicked.

The file path is based starting with the directory in which the HTML document is located.
Opt urlTargetFrame The name of the target frame in which the URL should be displayed.
Opt urlDescription The text string specified for this parameter will be displayed in the browser's status line when the mouse is moved over the button.
E xample

An example of a HTML APPLET tag with all parameters for this applet is shown below. Note that all images specified should be the same size, and that the image dimensions are used for the applet width and height parameters.


<APPLET CODE="URLImageButton.class" WIDTH="90" HEIGHT="28">
<PARAM NAME="buttonImage" VALUE="Button.JPG">
<PARAM NAME="mouseOverImage" VALUE="ButtonSelected.JPG">
<PARAM NAME="mouseDownImage" VALUE="ButtonClicked.JPG">
<PARAM NAME="frameColor" VALUE="FFFFFF">
<PARAM NAME="url" VALUE="Home.html">
<PARAM NAME="urlTargetFrame" VALUE="Content"
<PARAM NAME="urlDescription" VALUE="Jump to Home Page">
</APPLET>

D ownload

The applet URLImageButton, along with a copy of this documentation, is available for download as a standard zip file, as a self-extracting file (for Windows95/NT users), or as a self-installing Java class file.
C opyright

This documentation and the URLImageButton object code may be copied and distributed freely for non-commercial purposes so long as neither the code nor the documentation is altered in any way. If the URLImageButton code is distributed with any documentation whatsoever, then this unaltered document must accompany the code.


Copyright © 1997, 1998 by Modern Minds, Inc.