import java.awt.event.*;public class ExitWindow extends WindowAdapter {
public void windowClosing(WindowEvent e) {  //这个方法中提供的参数(WindowEvent e)有什么用啊
System.exit(0);//这当中的整数值如果是1或者2情况是怎样的呢
}
}
import javax.swing.JFrame;public class ExitFrame extends JFrame {
public ExitFrame () {
super("Java World");
setSize(300,100);
ExitWindow exit=new ExitWindow();
addWindowListener(exit);//这句有什么用呢?它传递的参数(exit)是指哪个
setVisible(true);
}

public static void main(String[] args) {
ExitFrame sf=new ExitFrame();
}
}问题已经写在注释里了,大家帮帮忙,谢谢。