title: Swing - How to close a form from inside? How to close the form without affecting the parent form?
body: <p>I am creating a form in Swing toolkit.<br>
  When I want to close it, I go to the JFrame and set it to visible false.<br>
  Since the frame creates a Java class of the form, I can easily do it from outside.  </p>
  
  <p>When I have a cancel button I usually send a listener inside the form that calls the outer:</p>
  
  <pre><code> Jframe.setVisible (false)
  </code></pre>
  
  <p>Is there a better way ?  </p>