The Not-So-Rookie Rides Again - Coloring a button

Hi all,

I’ve got some buttons that I would like to add some color to. I can set the background on a button to a color, say, yellow. When I run this in the Web Client, I get a nice yellow button. When I run this in the Smart Client, tho, I get a grey button with a little yellow outline around it. I’ve looked at the parameters I can set in styles, and “background” seems to be the right thing, but I’m not getting the behavior that I expect in both clients.

I can build the buttons in Photoshop in the color I want and use that, but it seems like this should be working in the Smart Client. What am I missing?

As always, your guidance and advice are appreciated.

Thanks and have a good day.

Ron

The actual use of the background color you specify on buttons is up to the Look&Feel.
I know there are L&Fs (Windows L&F I think) that decide to ignore the set background color of buttons. Try it with another L&F and see if that works. For example Metal, Window Classic.

Changing showClick property (and horizontalAlignment to compensate) on Windows L&F buttons makes them paint background, but I don’t know if you want that - they no longer look the same. You should also test if you are ok with this on other L&Fs, OSes…

Hi Andrei,

Thanks for that information. I’ll look into that today.

May I ask where Timisoara is? I am, alas, a geography poor American. :oops:

Have a good day.

Ron

Such stereotypes :). I bet I don’t know many similar locations in the USA.

The location is updated as well.

Looks like a very nice place to live. Founded in 1212AD? My hometown, Chicago, IL, is a mere 175 years old, and the suburb I live in now, Hoffman Estates, only about 50 years old. Interesting that Timisoara’s nickname is “Little Vienna”. My mom was born and raised in Vienna, emigrating with my dad (a soldier in the U.S. army) after WWII to the U.S.

Thanks for that info. One of the cool little side benefits of working with Servoy is that I’ve gotten to “meet”, online, people from other countries. My kids have gotten to visit Europe through a student exchange program while I get to stay home and write code in my home office :D

And thanks again for the info on coloring buttons. I have a feeling that, when all is said and done, I may just make some buttons in Photoshop in the color that I want, and just use that instead.

Have a good day, Andrei.

Ron

Thanks; you as well. :wink: