• Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom JCheckBox Painting--UI Delegate

 
Will Baker
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to create a checkbox that represents 3 states (checked, gray-checked, unchecked). Is it absolutely necessary to delve into the UI-Delegate to accomplish this? If so what methods would I have to override? I only want to repaint the inner portion of the checkbox, not the whole background. I know I could just use gif icons and swap them, but I'm looking for a neater solution.
Anyone have any experience with this?
Thanks in advance,
Will
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this:
UIManager.put("CheckBoxMenuItem.selectionBackground", Color.GREY);
or blue or green etc. Also there are quite a few changes you can make after the CheckBoxMenuItem.whatever.
The only problem is this changes the checkbox universally so, you can't change each indivdual checkbox to another UI delegate. You would have to do that with icons like you stated earlier.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!