Closing second JFrame in JAVA (Netbeans) - event
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/13960824/closing-jframe-event-in-java-does-not-work">Closing JFrame event in JAVA - does not work</a>  </p>
</blockquote>



<p>I have 2 JFrames.
First JFrame is the main window in my program. Second JFrame appears when we click on button. When this second JFrame (called Settings) is visible, first JFrame, main program's window is disabled <code>setEnabled(false)</code>. When I'm closing Settings window my main window is not enabled again. Look at my code. I put there directive <code>setEnabled(true)</code> so it should work.</p>

<pre><code>    FrameSettings.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    FrameSettings.addWindowStateListener( new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            setEnabled(true);
        }
    });
</code></pre>
