title: How to close a Java SWT window with a button?
body: <p>As a newbie to Java, and many years of iOS and .NET experience, I found this to be massively confusing.  What I want I thought would be very simple - I want a dialog (called from a main window) with OK and Cancel buttons.  When you click OK, it does something, then dismisses the dialog.  When you click Cancel, it just dismisses the dialog.</p>
  
  <p>However, doing this using the SWT shell Dialog class is not obvious.  How do you get a button to dismiss the dialog, and return execution back to the main Window?</p>