本人今天写了这小程序,想显示y=x*x这条直线,但怎么显示不出来? import java.applet.Applet; import java.awt.*;
public class Myline extends Applet { int []x; int []y; int num_init=1; public void paint(Graphics g) { drawmy(g); } public void drawmy(Graphics g) { for(int i=0;i<100;i++) { x[i]=num_init; y[i]=x[i]*x[i]; num_init++; } g.drawPolyline(x,y,100); } }