简体   繁体   English

用渐变颜色绘制按钮边框

[英]Draw button border with gradient color

I want to draw a button border like this with gradient color at border of rounded button (the red one): 我想在圆形按钮的边框(红色边框)上绘制一个渐变颜色的按钮边框:

在此处输入图片说明

Does anybody know some Java class that can do this? 有人知道某些Java类可以做到这一点吗?

You can create your custom Button class by extending JButton. 您可以通过扩展JButton来创建自定义Button类。 Then you have to rewrite the paintComponent(Grapgics g) mehtod to draw your button like you want. 然后,您必须重写paintComponent(Grapgics g)方法,以根据需要绘制按钮。

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

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