📄 quitbyeventaction.java
字号:
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
class QuitByEventAction{
public static void main(String[] args) {
MyFrameTwo myFrame=new MyFrameTwo();
myFrame.show();
}
}
class MyFrameTwo extends JFrame{
MyFrameTwo(){
setSize(400,200);
addWindowListener(new QuitWindow());
}
}
class QuitWindow extends WindowAdapter{
public void windowClosing(WindowEvent e){
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -