title: Java SWT shell window closing event
body: <p>I just have a quick question.</p>
  
  <p>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.</p>
  
  <p>I tried something simple:</p>
  
  <pre><code>shell.addListener(SWT.Close, new Listener() {
        public void handleEvent(Event event) {
          shell.setVisible(false);
        }
      });
  </code></pre>
  
  <p>Still terminates the program.</p>
  
  <p>Thanks in advance.</p>