title: How to Close JInternalFrame when JButton click and show another JInternalFrame?
body: <p>For Example:</p>
  
  <p>When <code>JButton1</code> click <code>JInternalFrame1</code> Show on the <code>JDesktopPane</code>
  And when <code>JButton2</code> Click <code>JInternalFrame1</code> Close and <code>JInternalFrame2</code> Show on the <code>JDesktopPane</code>.</p>
  
  <p>thx before</p>
  
  <p>Edit: with code from comment</p>
  
  <pre><code>if (JInternalFrame1 == null) { 
      JInternalFrame1 = new FJInternalFrame(); 
      Desktop.add(JInternalFrame1); 
      JInternalFrame1.toFront();
  } else { 
      JInternalFrame1.dispose();
  }
  </code></pre>