Hello all,
I have searched this newsgroup for the answer as to how to change the
toggle button background color when it has been selected with no
viable results. By viable, I mean responses that worked when I
implemented them.
Prior responses are:
August 23, 2002: UIManager.put("ToggleButton.select", new
ColorUIResource(color));
August 6, 2004: UIManager.put("ToggleButton.select", Color.green);
If these are other ways of changing the selected (or activated)
background on a toggle button, I would love to know about them.
Thanks in advance for you help,
Todd
Knute Johnson - 29 Aug 2007 04:19 GMT
> Hello all,
>
[quoted text clipped - 14 lines]
> Thanks in advance for you help,
> Todd
Todd:
That's pretty much what I would have tried, and I did, but it doesn't
work as you already know. It appears that it changes the value in the
defaults but the color doesn't change. I guess I don't know how to do
it, sorry.
I did try to change the UIDefaults of the current LookAndFeel with the
same results.

Signature
Knute Johnson
email s/nospam/knute/
Roedy Green - 30 Aug 2007 04:34 GMT
>I have searched this newsgroup for the answer as to how to change the
>toggle button background color when it has been selected with no
>viable results. By viable, I mean responses that worked when I
>implemented them.
You can use an icon of various colours. See
http://mindprod.com/jgloss/jbutton.html
This works fine. You can have variations for rollover, selected,
hovered, pressed etc etc. I have used this for years, so I know it
works.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Michael Jung - 30 Aug 2007 19:38 GMT
> I have searched this newsgroup for the answer as to how to change the
> toggle button background color when it has been selected with no
[quoted text clipped - 4 lines]
> ColorUIResource(color));
> August 6, 2004: UIManager.put("ToggleButton.select", Color.green);
Change the background in your eventlistener. That has the
advantage/disadvantage that it is keyed to a specific button. The above
solutions change them for all.
Michael