title: How can I stop my application?
body: <p>I have the main thread from which I start a window using <code>invokeLater</code>. I run my application from command line. So, when application is running I see the window and my command line is "blocked" by the application.</p>
  
  <p>I can stop the application either by closing the window (as a result the command line is unblocked) or by typing <code>Ctrl-C</code> in the command line (as a result the window disappear).</p>
  
  <p>I wanted to be able to stop the application by clicking on a button in the window of the application. I used <code>setVisible(false)</code> for that. But in this way I can achieve the goal only partially. My window really disappear but the command line is still blocked. So, the software is still running. </p>
  
  <p>Well, I assume it's because some other threads are still running. But how can I easily close all these threads (like I do by closing the window of the application manually). </p>