I just have a quick question.
How do you override the window closing event for a shell in an swt application? I want the X-Button to simple hide the shell, not close the program.
I tried something simple:
shell.addListener(SWT.Close, new Listener() {
public void handleEvent(Event event) {
shell.setVisible(false);
}
});
Still terminates the program.
Thanks in advance.
You could try
shell.addListener(SWT.Close, new Listener() {
public void handleEvent(Event event) {
event.doit = false;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With