Button Highlight - XML Tutorial
Version 1.6

This is the archives. For the latest Bambookit GUI 2.0, XML GUI Demos & Tutorials visit: www.bambookit.com/_demo.html

Button's Property: setHighlight, setRollover, setBackgroundHighlight, setForegroundHighlight

Button is part of the GUI elements in Bamboo Suite for building interactive Internet applications. setHighlight, setRollover, setBackgroundHilight, setForegroundHilight are buttons properties that are used in the XML files to add colors highlights to the background and foreground of the buttons. Keep in mind that there is default highlight background and foreground colors. In case of BackgroundHighlight set to any color, default foreground is always set to white, which means that setting background highlight to the light colors will make foreground color almost invisible. This is demonstrated on the applet on the left in 'lavender'. We had to set setForeground("000066") and setForegroundHighlight(000066) to the same dark color to remove the white defaults settings for foreground colors, while the ‘rose’ button displays default white settings for foreground.
On another hand default BackgroundHighlight is always set to the dark gray. So if we want to set highlight only for foreground colors, we have to set BackgroundHighlight to match applet background color ("f8f4db") to make it possible. This is demonstrated in the 'mint' and 'chamomile' buttons in the applet on the left.

Refer to Reference for complete list of Buttons Properties.

See complete XML source for this applet.

HTML Source:
<applet archive="bamboo_1_5.jar" code="Loader.class" width=110 height=400>
<param name="gui" value="tutorials_button_highlights.xml">

button_highlights.XML Source:

<Widget setSize="110,400" setBackground="f8f4db">
<Widget setShape="10,10,90,25" setLabel="Highlight" setFontstyle="bold" setOpaque="false"/>
<Button setShape="10,40,90,25" setLabel="true" setHighlight="true"/>
<Button setShape="10,70,90,25" setLabel="false" setHighlight="false"/>
<Widget setShape="10,100,90,25" setLabel="Rollover" setFontstyle="bold" setOpaque="false"/>
<Button setShape="10,130,90,25" setLabel="true" setRollover="true"/>
<Button setShape="10,160,90,25" setLabel="false" setRollover="false"/>
<Widget setShape="10,190,90,15" setLabel="Background" setFontstyle="bold" setOpaque="false"/>
<Widget setShape="10,205,90,15" setLabel="Highlight" setFontstyle="bold" setOpaque="false"/>
<Button setShape="10,220,90,25" setLabel="rose" setBackground="666699" setBackgroundHighlight="663399"/>
<Button setShape="10,250,90,25" setLabel="lavander" setBackground="666699" setForeground="000066" setForegroundHighlight(000066) setBackgroundHighlight("663399")></Button>
<Widget setShape="10,280,90,15" setLabel="Foreground" setFontstyle="bold" setOpaque="false"/>
<Widget setShape="10,295,90,15" setLabel="Highlight" setFontstyle="bold" setOpaque="false"/>
<Button setShape="10,310,90,25" setLabel="mint" setForeground="666699" setForegroundHighlight="000066" setBackgroundhighlight="f8f4db"/>
<Button setShape="10,340,90,25" setLabel="chamomile" setForeground="666699"

[Home][Tutorial] [Demo]

Shape Borders Fonts & Colors Highlights Images Actions Other