Hello,
I want to show a "Confirm Close" window when closing the main app window, but without making it disappear. Right now I am using a windowsListener, and more specifially the windowsClosing event. But, this when using this event, the main window is closed and I want to keep it opened.
He you have a chunk of the code I am using:
To register the listener
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
thisWindowClosing(evt);
}
});
The implementation of the handling event:
private void thisWindowClosing(WindowEvent evt) {
new closeWindow(this);
}
Also I've tried using this.setVisible(true) in the thisWindowClosing() method but it doesn't work.
Any suggestions?
Thanks in advanced!