当前页面: JAVA 编程资料牛鼻论坛 → Java & J2SE 技术区→java好像有一个字体颜色的控件,是哪个类? |
int style
是名为"JColorChooser"的类,方法是(假设文本框名为text1)
{
Color newColor=JColorChooser.showDialog(this,"字体颜色",text1.getForeground());
text1.setForeground(newColor);
}
这样就可以了!(会弹出对话框)