简体   繁体   English

添加边框到jcheckbox

[英]adding border to jcheckbox

Does anyone know if there is an easy way to put a border around a JCheckBox object including the label? 有没有人知道是否有一种简单的方法可以在包含标签的JCheckBox对象周围放置边框? setBorder doesn't seem to have any effect. setBorder似乎没有任何效果。 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? 我知道我可以将每个复选框放在JPanel和边框内,但是没有办法将整个JCheckBox自身边界化? Thanks 谢谢

on a jcheckbox the setborder does work, its just that the border is not painted. 在一个jcheckbox上,setborder可以工作,只是边框没有画。 all you have to do is call setBorderPainted(true) and it should work. 你所要做的就是调用setBorderPainted(true),它应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM