给要通过关闭按钮关闭的窗口添加WindowAdapter消息处理.例如
***.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
本文介绍如何使用WindowAdapter为Java窗口添加关闭监听事件处理程序。通过匿名内部类实现,在窗口关闭时执行特定操作。
给要通过关闭按钮关闭的窗口添加WindowAdapter消息处理.例如
***.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
245

被折叠的 条评论
为什么被折叠?