title: Wait for Swing GUI to close before continuing
body: <p>I am writing an app that requires the user to enter some data into a Swing GUI which the app will then use. After the user enters the data, there is no longer any need for the GUI as the app will then write some data to files.</p>
  
  <p>The General idea is this:</p>
  
  <pre><code>launchGui();
  closeGui();
  continueWithComputation();
  </code></pre>
  
  <p>I understand that Swing uses a few threads in the background which I understand is why the program doesn't block until the GUI is closed.</p>
  
  <p>Is it possible in any way to wait for the GUI to close (single <code>JFrame</code> closed with <code>dispose()</code>) before continuing with <code>continueWithComputation()</code>?</p>