贵州省高考2016年几卷:关于JAVA的小代码

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/25 12:23:24
各位前辈:
俺刚自学JAVA
class ExitWindow extends WindowAdapter{
public void windowClosing(WindowEvent e){
System.exit(0);
}
}

上面那段是关闭窗口么?
那和setDefaultCloseOperation(EXIT_ON_CLOSE);有什么不同点呢?

谢谢

没错,是关闭窗口的代码。
和setDefaultCloseOperation(EXIT_ON_CLOSE);的效果完全一样。