java让JDialog真正的关闭……

2024-12-02 02:15:08
推荐回答(2个)
回答1:

setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {
dispose();
}
});
//这样就可以了,

回答2:

EXIT_ON_CLOSE