#java#设置textfield或其他组件字体的颜色

来源:互联网 发布:孙振耀。知乎 编辑:程序博客网 时间:2024/05/16 18:10

在java中如何设置textfield、button或其他组件里头字体的颜色呢?
以红色(RED)为例:

组件.setForeground(Color.RED)//设置文字的颜色(即前景色)。

而设置背景色则是:

组件.setBackground(Color.RED)//设置背景色。
阅读全文
0 0
原创粉丝点击