title: WindowConstants.EXIT_ON_CLOSE vs JFrame.EXIT_ON_CLOSE
body: <pre><code>mainGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  </code></pre>
  
  <p>Intellij Code Analysis:</p>
  
  <blockquote>
    <p>Warning:(33, 46) Must be one of: WindowConstants.DO_NOTHING_ON_CLOSE,
    WindowConstants.HIDE_ON_CLOSE, WindowConstants.DISPOSE_ON_CLOSE,
    WindowConstants.EXIT_ON_CLOSE</p>
  </blockquote>
  
  <p>SO,is it better to use  <code>WindowConstants.EXIT_ON_CLOSE</code> rather than  <code>JFrame.EXIT_ON_CLOSE</code>? </p>
  
  <p>Why?</p>