How to close JFrame followed by another JFrame?
<p>I have a JFrame panel. It opens several times. However, I want the previous one to close, right before the new one opens. </p>

<p>So is there a way to add some code implying "Close this JFrame when there is a trigger to execute the same JFrame."</p>

<p>It is the same JFrame but the information (JTextFields) change. </p>

<p>Right now through out the program, where ever there is a method, object calling for the JFrame:     </p>

<pre><code>statusbar sb = new statusbar();
        sb.setting();
</code></pre>

<p>and if I have this statement again, it will open another JFrame on top of it. but i want to close the previous one. </p>
