首页 > 其他 > 详细

e566. 关闭的时候关闭程序

时间:2018-09-06 10:14:34      阅读:134      评论:0      收藏:0      [点我收藏+]

By default, when the close button on a frame is clicked, nothing happens. This example shows how to exit the application when the frame is closed:

    // Create a frame
    Frame frame = new Frame();
    
    // Add a listener for the close event
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            // Exit the application
            System.exit(0);
        }
    });
    

 

Related Examples

e566. 关闭的时候关闭程序

原文:https://www.cnblogs.com/borter/p/9596107.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!