职场爱情经典小说推荐:关于JAVA的小代码

来源:百度文库 编辑:高考问答 时间:2024/07/08 14:30:57
各位前辈:
俺刚自学JAVA
class ExitWindow extends WindowAdapter{
public void windowClosing(WindowEvent e){
System.exit(0);
}
}

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

谢谢

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