首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

字体颜色的设置,该怎么处理

2012-03-23 
字体颜色的设置if(e.getActionCommand().equals(字体颜色)){Color cJColorChooser.showDialog(this,请

字体颜色的设置
if(e.getActionCommand().equals("字体颜色")){
Color c=JColorChooser.showDialog(this,"请选择文字颜色",Color.BLACK);
sendArea.setForeground(c);
sendArea.requestFocusInWindow();
msgListArea.setForeground(c);
msgListArea.requestFocusInWindow();


}
 sendArea是发送区域;msgListArea是显示信息的区域。
为什么在设置字体颜色时,发送区域不显示字体的颜色,只有显示区域显示字体的颜色

[解决办法]
sendArea.updateUI()试试

热点排行