📄 mywindowlistener.java
字号:
package MyLibraryok.MyMain;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
import javax.swing.JOptionPane;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2007</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class myWindowListener implements WindowListener{
MainFrame2 myMainFrame;
public myWindowListener(MainFrame2 myMainFrame) {
this.myMainFrame=myMainFrame;
}
// public static void main(String[] args) {
// myWindowListener myWindowListener1 = new myWindowListener();
// }
/**
* windowActivated
*
* @param e WindowEvent
*/
public void windowActivated(WindowEvent e) {
System.out.println("windowActivated");
}
/**
* windowClosed
*
* @param e WindowEvent
*/
public void windowClosed(WindowEvent e) {
System.out.println("windowClosed(");
}
/**
* windowClosing
*
* @param e WindowEvent
*/
public void windowClosing(WindowEvent e) {
new SleepFrame();
myMainFrame.setVisible(false);
// int s = JOptionPane.showConfirmDialog(null, "是否退出", "退出",
// JOptionPane.YES_NO_OPTION);
// if (s == JOptionPane.YES_OPTION) {
// System.exit(0);
//
// } else {
//
//
// }
}
/**
* windowDeactivated
*
* @param e WindowEvent
*/
public void windowDeactivated(WindowEvent e) {
System.out.println("windowDeactivated(");
}
/**
* windowDeiconified
*
* @param e WindowEvent
*/
public void windowDeiconified(WindowEvent e) {
System.out.println("windowDeiconified(");
}
/**
* windowIconified
*
* @param e WindowEvent
*/
public void windowIconified(WindowEvent e) {
System.out.println("windowIconified(");
}
/**
* windowOpened
*
* @param e WindowEvent
*/
public void windowOpened(WindowEvent e) {
System.out.println("windowOpened(");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -