import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class Snake extends Frame {
public static void main(String[] args){
new Snake().launch();
}
public void launch(){
this.setTitle("snake");
//标题
this.setSize(550, 500);
//大小
this.setLocation(300, 400);
//位置
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
//窗口时间 可以关闭
this.setResizable(false);
//不能更改大小
this.setVisible(true);
//能被看见
}
}