j2se 中jframe 如何点击button,更改textarea中的字体颜色
答案:2 悬赏:50 手机版
解决时间 2021-02-08 16:57
- 提问者网友:沉默的哀伤
- 2021-02-08 04:58
j2se 中jframe 如何点击button,更改textarea中的字体颜色
最佳答案
- 五星知识达人网友:往事隔山水
- 2021-02-08 06:35
得到Textarea对象ta,调用下面方法就可以设置字体颜色
ta.setForeground(Color.gray);
ta.setForeground(Color.gray);
全部回答
- 1楼网友:蕴藏春秋
- 2021-02-08 08:05
调用这个方法
public void setForeground(Color fg)
Sets the foreground color of this component. It is up to the
look and feel to honor this property, some may choose to ignore
it.
Overrides:
setForeground in class Component
Parameters:
fg - the desired foreground Color
See Also:
Component.getForeground()
public void setForeground(Color fg)
Sets the foreground color of this component. It is up to the
look and feel to honor this property, some may choose to ignore
it.
Overrides:
setForeground in class Component
Parameters:
fg - the desired foreground Color
See Also:
Component.getForeground()
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯