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 / February 2005

Tip: Looking for answers? Try searching our database.

JCheckBox problem Please help

Thread view: 
Praveen homkar - 22 Feb 2005 09:31 GMT
Hi  All

My question is how to  remove the border from inner rectangle of a
JCheckBox.

A JCheckBox has 2 rectangles,it is possible to remove the boder from the
outside one ,but what about the rectangle where the user clicks.(I am
referring this rectangle as inner rectangle)

Hoping a quick reply

Praveen
John McGrath - 24 Feb 2005 11:46 GMT
> My question is how to  remove the border from inner rectangle of a
> JCheckBox.
>
> A JCheckBox has 2 rectangles,it is possible to remove the boder from the
> outside one ,but what about the rectangle where the user clicks.(I am
> referring this rectangle as inner rectangle)

Are you referring to the checkbox icon?  That is the little box that is on
the left (by default) and that contains the check mark.  The Icon for a
JCheckBox (and for a JRadioButton, too) is a little more aware of its
context than most icons.  It looks at the JCheckBox's model and paints
itself differently depending on whether the model is selected.

You can create your own "select-aware" Icon implementation and replace the
icon for the JCheckBox.  For an example of how this is done, see one of
the standard checkbox icons, such as
javax.swing.plaf.metal.MetalCheckBoxIcon.

Be aware that this is look-and-feel dependent, so even if your icon looks
fine with one L&F, it may no look so good if the user changes the L&F.
Unless you are in control of the L&F, you may need to consider this.

Signature

Regards,

John McGrath

Praveen homkar - 25 Feb 2005 04:44 GMT
Hi John McGrath

Thank you very much for the help.

idea of changing the icon works.

praveen


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.