📄 myframewithexithandling.java
字号:
import java.awt.*;
import java.awt.event.*;
public class MyFrameWithExitHandling extends Frame
implements WindowListener
{
public MyFrameWithExitHandling(String str)
{
super(str);
addWindowListener(this);
}
public MyFrameWithExitHandling()
{
super();
addWindowListener(this);
}
public void windowClosed(WindowEvent event)
{
}
public void windowDeiconified(WindowEvent event)
{
}
public void windowIconified(WindowEvent event)
{
}
public void windowActivated(WindowEvent event)
{
}
public void windowDeactivated(WindowEvent event)
{
}
public void windowOpened(WindowEvent event)
{
}
public void windowClosing(WindowEvent event)
{
dispose();
System.exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -