this.addWindowFocusListener(new WindowAdapter(){
改亮丛成脊键碰
this.addWindowListener(new WindowAdapter(){
/段神/ 要用到其他的地方去.只要复制我标识的中间点就可以了.import java.awt.event.WindowAdapter
import java.awt.event.WindowEvent
import javax.swing.JFrame
import javax.swing.JOptionPane
public class tt extends JFrame {
public tt() {
//-------------------- 关闭监听----------
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
int a = JOptionPane.showConfirmDialog(null, "确定蔽升关闭吗?宏燃老", "温馨提示",
JOptionPane.YES_NO_OPTION)
if (a == 0) {
System.exit(0) //关闭
}
}
})
//--------------------
setSize(100, 100)
setVisible(true)
}
public static void main(String[] args) {
tt t = new tt()
t.setDefaultCloseOperation(3)
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)