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 / GUI / June 2007

Tip: Looking for answers? Try searching our database.

Change the color of the checkmark of  JCheckbox

Thread view: 
deel007@googlemail.com - 19 Jun 2007 09:37 GMT
Hello,

I am trying  to custumize a  JCheckbox by changing the color of the
checkmark , but i dont know how !!
any idea ?

best regards
Roedy Green - 19 Jun 2007 09:47 GMT
>I am trying  to custumize a  JCheckbox by changing the color of the
>checkmark , but i dont know how !!

The official way to do that would be to create your own custom look
and feel variant.  see http://mindprod.com/jgloss/laf.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Laird Nelson - 19 Jun 2007 13:45 GMT
On Jun 19, 4:47 am, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> The official way to do that would be to create your own custom look
> and feel variant.  seehttp://mindprod.com/jgloss/laf.html

Seems like you could simply install your own icon under the UIDefaults
key "CheckBoxUI.icon".  By default, you get the one manufactured by
BasicIconFactory.getCheckBoxIcon().

Laird
Michael Dunn - 19 Jun 2007 19:49 GMT
> Hello,
>
> I am trying  to custumize a  JCheckbox by changing the color of the
> checkmark , but i dont know how !!
> any idea ?

Open the source code of MetalIconFactory
copy the static inner class CheckBoxIcon
add it as an inner class to your program
change the color in drawCheck()
set the new icon, either
a) use a CheckBox constructor with icon as argument, or
b) *both* checkbox.setIcon(...) and checkbox.setSelectedIcon(...)
deel007@googlemail.com - 21 Jun 2007 00:36 GMT
> Open the source code of MetalIconFactory
> copy the static inner class CheckBoxIcon
[quoted text clipped - 3 lines]
> a) use a CheckBox constructor with icon as argument, or
> b) *both* checkbox.setIcon(...) and checkbox.setSelectedIcon(...)

Thanks guys it works now.


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.