class apple0804 extends Frame {
public static void main(String [] args) {
Frame f=new apple0804();
f.setTitle("apple0804");
f.setSize(600,600);
f.setBackground(Color.yellow);
f.setVisible(true);
}
apple0804(){addWindowListener(new stopwin());}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
public void paint(Graphics g){
int x[] =new int[11];
int n;
g.setColor(Color.blue);
for (n=1;n<11;n++){
x[n]=n*n;
}
for (n=1;n<10;n++){
g.drawLine(10*n,x[n],10*(n+1),x[n+1]);
}
}
}
最終更新:2010年09月14日 00:06