Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CheckBox - how to set custom icons

viklund_andersJun 20 2013 — edited Jun 20 2013

I need to figure out how to set a custom icon for a selected checkbox via the UIManager

This works for un-selected checkboxes:

UIManager.put("CheckBox.icon", new ImageIcon("../images/unselectedCheckBoxIcon.png"))); 

how to change the icon when it is selected?

I don't know the UIManager property for a selected checkbox icon and using the setSelectedIcon on the checkbox object it self does not seem to work:

checkbox.setSelectedIcon(new ImageIcon("../images/selectedCheckBoxIcon.png")); 

Thanks for any ideas how to solve this!!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2013
Added on Jun 20 2013
2 comments
3,926 views