gpt4 book ai didi

java - Swing JButton 的圆角 Swing 没有实际 JButton 的功能

转载 作者:搜寻专家 更新时间:2023-11-01 03:23:28 24 4
gpt4 key购买 nike

<分区>

![ 1

我已经查看了 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.

我该怎么办?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com