⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windowcloser.java

📁 拥有图形界面的
💻 JAVA
字号:
/** * Utility class to catch window close events on a target * window and actually dispose the window. */package org.joone.edit;import java.awt.*;import java.awt.event.*;public class WindowCloser implements WindowListener {   /**    * Create an adaptor to listen for window closing events    * on the given window and actually perform the close.    */    public WindowCloser(Window w) {	this(w, false);    }   /**    * Create an adaptor to listen for window closing events    * on the given window and actually perform the close.    * If "exitOnClose" is true we do a System.exit on close.    */    public WindowCloser(Window w, boolean exitOnClose) {	this.exitOnClose = exitOnClose;	w.addWindowListener(this);    }    public void windowOpened(WindowEvent e) {    }    public void windowClosing(WindowEvent e) {	if (exitOnClose) {            System.exit(0);	}	e.getWindow().dispose();    }    public void windowClosed(WindowEvent e) {	if (exitOnClose) {            System.exit(0);	}    }    public void windowIconified(WindowEvent e) {    }    public void windowDeiconified(WindowEvent e) {    }    public void windowActivated(WindowEvent e) {    }    public void windowDeactivated(WindowEvent e) {    }    private boolean exitOnClose;}

⌨️ 快捷键说明

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