<分区>
我已经查看了 Java documentation for Swing look and feel 上的代码, 但我找不到太多关于如何修改 JButtons
的默认外观的信息。
我想在 Swing 中为 JButtons
设置圆角/曲角
。
有办法实现吗? 我应该使用哪些函数和值?
我使用了下面的语句:
generateButton.setBorder(new RoundedBorder(20));
我在 Stack Overflow 问题中找到的 RoundedBorder 代码 Rounded Swing JButton using Java :
I do get a black rounded border outline around the original button. MY button has orange background. But it doesn't remove the orange area outside the rounded corners. Also I do not want the black border.
我该怎么办?