title: System.exit(0) vs JFrame.EXIT_ON_CLOSE
body: <p>Is there any difference between the two. I was reading an article ( <a href="http://www.javalobby.org/java/forums/t17933" rel="noreferrer">http://www.javalobby.org/java/forums/t17933</a> ) about that you should always use</p>
  
  <pre><code>System.exit(0);
  </code></pre>
  
  <p>Currently I use </p>
  
  <pre><code>JFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
  </code></pre>
  
  <p>The article says that even for a Java Swing Application you should add a listener <code>WindowAdapter</code> and and call <code>System.exit()</code> inside its method <code>windowClosing(WindowEvent e)</code>. </p>
  
  <p>Is there any difference? Is one method better then the other?</p>