Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding border to jcheckbox

Does anyone know if there is an easy way to put a border around a JCheckBox object including the label? setBorder doesn't seem to have any effect. I know I could put each checkbox inside of a JPanel and border that, but is there no way to border the entire JCheckBox by itself? Thanks

like image 955
f1wade Avatar asked Dec 02 '10 12:12

f1wade


People also ask

How do I add a border to a JFrame?

Yes you can draw the borders around the undecorated JFrame. Just simply get the root pane of the JFrame and set its borders by setBorder(Border border) method. As far as I know, this will only shrink down the root pane so it can draw the border inside the frame itself.


1 Answers

on a jcheckbox the setborder does work, its just that the border is not painted. all you have to do is call setBorderPainted(true) and it should work.

like image 91
f1wade Avatar answered Sep 24 '22 03:09

f1wade