1
我有一个表在Java小程序中创建一个嵌套循环,在此循环中,我应该更改颜色,如图所示。Java小应用程序:嵌套循环颜色变化
现在我成功了,但我不能改变颜色,因为每次我尝试一个论坛,它不起作用。
这里是我的代码
int x = 63;
for (int r=1; r<=10;r++)
{
Color C = new Color(0,10 +(x * 2),0);
for (int c=0; c<=4; c++)
{
Color C2 = new Color(10 + (x * 2) ,0,0);
g.setColor(C2);
Font F = new Font("Arial",Font.BOLD, 24);
g.setFont(F);
g.drawString("Hello",10 + (c * 60), r * 25);
}
}
alt text http://img291.imageshack.us/img291/2707/15219320.png
我应该怎么做才能使工作?
非常感谢你为这个: ) – Bader 2010-05-09 00:57:58