tags:

views:

175

answers:

1

Is there an easy way to make the background of a JCheckBox transparent? The box itself and the text should both be ordinary colored.

Thanks in advance

+1  A: 
setOpaque(false);

That line will make the background of the JCheckBox not be drawn. It will be the color of whatever Component it is on.

If you are subclassing a JCheckBox, just place that line in the constructor. Otherwise call it on an instance of the JCheckBox.

jjnguy