当前位置: 代码迷 >> Eclipse >> 字体颜色的设置,该怎么处理
  详细解决方案

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

热度:75   发布时间:2016-04-23 13:52:42.0
字体颜色的设置
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()试试
  相关解决方案