|
 |
The height and width values in the applet tag determine the height and width of button bar.
|
|
 |
The stick parameter enables the "sticky button" behavior and also
determines the number of the button that will initially be "stuck" in the buttonDown
position when the applet is initialized.
|
|
 |
The button bar uses a little trick to create the "mouseOver" image.
In this example, there are no special attributes for the "mouseOver"
button state -- it is identical to the "base" button state. Since
there is no difference between the two states, the applet uses the base state
for the mouseOver state (in addition to using it for the base state). Since we
told the applet to emboss the base state, it follows that the mouseOver state
will also appear embossed (since both states use the same image). By default,
the applet converts the base state to grayscale so we end up with an embossed
grayscale image for the base state, and an embossed normal (non-grayscale) image
for the mouseOver state.
In this instance, we do not want an embossed
image for the mouseOver state -- we would prefer to have a regular image
instead. In order to do this, we "trick" the applet into creating a
normal image by using the "button1TextOver"
parameter and assigning it the same text as the "button1Text"
parameter. This forces the applet to create a normal (un-embossed) mouseOver
button image.
Most of the time you will not need this little trick, but
it doesn't hurt to keep it in mind for the times that it could be useful.
|
|
 |
The applet shown above on the right uses the
mouseOverBrighten and moBrightenTint parameters
to create the mouseOver button images.
The tint color used to create the mouseOver button images is a blue-green color
that looks rather ugly by itself, but when the color value is added to the colors in the button bar image,
a pleasant range of blues results.
The point to remember is that sometimes color combinations may produce unexpected results. The secret
to successful tinting is to note that the tint color is always added to the color of each pixel
in the button bar image.
|
|
 |
The applet shown above on the left (i.e., the applet that uses the
mouseDownBrighten and mdBrightenTint parameters) uses a trick in order to create
the highlighted mouseDownOver button images without altering the standard un-highlighted mouseDown button images.
Remember that if button borders are drawn for the mouseDown state, then the
mouseDownBrighten and mdBrightenTint parameters
are ignored (unless the mdBrightenAll parameter is set to true).
This causes the mouseDown buttons to be drawn using the same colors as the base button bar buttons. The
mouseDownOver images, however, are created by "brightening" and "tinting" the mouseDown buttons.
The net result of this is that the mouseDown image is brightened using the
mouseDownBrighten and mdBrightenTint parameters
to create the "brightened" and "tinted" mouseDownOver button images.
|
|
 |
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. |