如何向 jradiobutton 添加圆形边框
您好,我需要添加一个圆形边框,可以蚀刻、斜切等。 对于 JRadioButton。 让按钮保持其圆形外观。
但我找不到任何圆形边框。
有谁知道该怎么做? 奇斯
Hi I need to add a Round Border, that could be etched, beveled etc.
for a JRadioButton.
to allow the button to keep its round appearance.
but i cannot find any round borders.
does anyone know how to do this?
chis
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以实现
Border
界面,使用drawRoundRect( )
或
。paintBorder()
中的drawOval()You can implement the
Border
interface, usingdrawRoundRect()
ordrawOval()
inpaintBorder()
.谢谢,这是一种选择,但我试图不添加我自己的实现,因为这会限制其他人对软件的重用性。
我目前有
JRadioButton.setBorder(new EchtedBorder(..));
JRadioBUtton.setBorderPainted(true); //使其实际为单选按钮绘制。
但它随后显示为方形,内部带有默认的单选按钮(即圆形)。
我想知道是否有办法让单选按钮保持其自然的圆形?
thanks thats one option, but im trying not to add my own implementation, as that would then limit reusability of the software by others.
i currently had
JRadioButton.setBorder(new EchtedBorder(..));
JRadioBUtton.setBorderPainted(true); //to make it actually be drawn for the radiobutton.
but it then appears square, with the default radiobutton (thats round) inside.
I wondered if there was ay way to get the radiobutton to obay its natural roundness?