title: enabling/disabling a JFrame after hiding another JFrame
body: <p>I have this 2 JFrame classes:</p>
  
  <pre><code>   public class Frame1 extends javax.swing.JFrame {
      setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        private JButton button1;
        button1 = new JButton("Open Frame2");
        private void button1ActionPerformed(java.awt.event.ActionEvent evt) {    
        this.setEnabled(false);  // disable Frame1 until Frame2 is showing              
        java.awt.EventQueue.invokeLater(new Runnable() {
              @Override
              public void run() {
                  Frame2 obj2 = new Frame2 ();
                  obj2.setVisible(true); 
              }
          });
        }
      }
  
  
   public class Frame2 extends javax.swing.JFrame {
    setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        public Frame2 () {
        this.setVisible(false);
        }
     Frame1 obj1 = new Frame1 ();
     private JButton button2;
        button2 = new JButton("Hide Frame2 and go to Frame1");
        private void button2ActionPerformed(java.awt.event.ActionEvent evt) {
             this.setVisible(false);
        }
      }
  </code></pre>
  
  <p>As you can see, when I click on <code>button1</code> <code>Frame1</code> gets disabled and <code>Frame2 obj2</code> is created.</p>
  
  <ol>
  <li>First of all I'd to know whether what I have done is a correct way to disable/defocus one parent <code>JFrame</code> to show another on top with focus.</li>
  <li>And then I just need to enable <code>Frame1</code> after hiding <code>Frame2</code>, something like <code>obj1.setEnabled(true)</code>. How can I do that?</li>
  </ol>