当前位置: 代码迷 >> Java相关 >> 走火,你的.class文件又到了
  详细解决方案

走火,你的.class文件又到了

热度:274   发布时间:2006-01-10 10:20:00.0
走火,你的.class文件又到了


你的程序有点小问题,我也没多看,只是帮你把编译通过了!修改完的代码如下:

import java.applet.Applet;
import java.awt.*;
public class Star extends Applet
{
int scount;
public void init()
{
scount=Integer.parseInt(getParameter("xinsu"));
}
public void paint(Graphics g)
{
g.setColor(Color.pink);
for(int i=0;i<scount;i++)
{
int x=(int)(getSize().width*Math.random());
int y=(int)(getSize().height*Math.random());
int xz[]={x,x+2,x+7,x+2,x,x-2,x-7,x-2,x};
int yz[]={y,y+7,y+7,y+9,y+14,y+9,y+7,y+7,y};
Polygon suzu=new Polygon(xz,yz,9);
g.fillPolygon(suzu);
}
}
}

搜索更多相关的解决方案: class  文件  走火  

----------------解决方案--------------------------------------------------------
  相关解决方案