日期:2014-05-20  浏览次数:20630 次

java有关applet的一个小问题
怎样设置applet小程序的文字颜色,比如applet显示“this is a test”,设置为红色。 谢谢。本人菜鸟..

------解决方案--------------------
首先,你的字是怎么显示的,是在Label上还是在Panel上
Label上用setForeground设置
Panel上通过paint方法实现,Graphics的drawString来显示,颜色用Graphics的setColor来设置