Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

Selected toggle button background color

Thread view: 
Todd - 28 Aug 2007 20:12 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.