title: Java swing dispose() method
body: <p>I wanted to make a simple text editor (note pad) in java, but I have run into a weird bug that if you open a new file, close it, then go to close the original file, the close button doesnt work... the other buttons work... All I have in the ActionListener is</p>
  
  <pre><code>frame.dispose();
  </code></pre>
  
  <p>is there another way to do this?
  EDIT: <code>System.exit(0);</code> </p>
  
  <p>works for me</p>