📄 exit.java
字号:
import java.awt.event.WindowListener;
import java.util.EventListener;
import javax.swing.*;
/**
* AWT Sample application
*
* @author
* @version 1.00 04/11/02
*/
public class Exit extends JFrame implements WindowListener{
public Exit(){
this.setSize(300,150);
this.addWindowListener(this);
}
public static void main(String[] args) {
// Create application frame.
Exit frame = new Exit();
// Show frame
frame.setVisible(true);
}
/**
* Method windowOpened
*
*
* @param e
*
*/
public void windowOpened(WindowEvent e) {
// TODO: Add your code here
}
/**
* Method windowClosing
*
*
* @param e
*
*/
public void windowClosing(WindowEvent e) {
System.exit(0);
// TODO: Add your code here
}
/**
* Method windowClosed
*
*
* @param e
*
*/
public void windowClosed(WindowEvent e) {
// TODO: Add your code here
}
/**
* Method windowIconified
*
*
* @param e
*
*/
public void windowIconified(WindowEvent e) {
// TODO: Add your code here
}
/**
* Method windowDeiconified
*
*
* @param e
*
*/
public void windowDeiconified(WindowEvent e) {
// TODO: Add your code here
}
/**
* Method windowActivated
*
*
* @param e
*
*/
public void windowActivated(WindowEvent e) {
// TODO: Add your code here
}
/**
* Method windowDeactivated
*
*
* @param e
*
*/
public void windowDeactivated(WindowEvent e) {
// TODO: Add your code here
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -