import java.awt.*;
import java.awt.event.*;
class game extends Frame{
public static void main(String [] args) {
Frame f=new game();
f.setTitle("game");
f.setSize(700,700);
f.setBackground(Color.yellow);
f.setVisible(true);
}
game(){
addWindowListener(new stopwin());
}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
public void paint(Graphics g){
int m,n;
int[] x=new int[5];
int[] y=new int[5];
x[1]=0;
y[1]=0;
x[2]=350;
y[2]=0;
x[3]=0;
y[3]=350;
x[4]=350;
y[4]=350;
for(m=1;m<5;m++){
g.setColor(Color.black);
g.fillRect(x[m],y[m],350,350);
}
}
}
最終更新:2011年07月12日 13:32