windowdestroyer.java

来自「网络聊天」· Java 代码 · 共 19 行

JAVA
19
字号
package gui;

import java.awt.*;
import java.awt.event.*;

/**
 If you register an object of this class as a listener to any
 object of the class JFrame, then if the user clicks the
 close-window button in the JFrame, the object of this class
 will end the program and close the JFrame.
*/
public class WindowDestroyer extends WindowAdapter
{
    public void windowClosing(WindowEvent e)
    {
        System.exit(0);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?