21行错误
addWindowListener(new WindowAdapter()){
                                     ^
public void windowClosing(WindowEvent e){
System.exit(0);
}
}
改为
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
 ^^
注意看改动的地方,加了^