title: JFrame wont show in netbeans platform
body: <p>I have application build on netbeans project extension. I need to show new separated Jframe on button click in TopComponet. But when I call frame.setVisible(true) nothing happens. I tried method pack() and it doesn't help.</p>
  
  <pre><code>public void onClick(){
     MyFrame frame = new MyFrame();
     frame.pack();
     frame.setVisible(true);
  }
  </code></pre>
  
  <p>I already read a few people had same problem but I haven't found any solution.</p>
  
  <p>MyFrame Class</p>
  
  <pre><code>public class MyFrame extends javax.swing.JFrame {
  public MyFrame() {
      initComponents();
  }
  
  private void initComponents() {    
      setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  
      javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
      getContentPane().setLayout(layout);
      layout.setHorizontalGroup(
          layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGap(0, 400, Short.MAX_VALUE)
      );
      layout.setVerticalGroup(
          layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGap(0, 300, Short.MAX_VALUE)
      );
  
      pack();
  }            
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <pre><code>javax.swing.JFrame t = new javax.swing.JFrame("test");
  t.pack();
  t.setVisible(true);
  //works
  
  MyFrame t = new MyFrame();
  t.pack();
  t.setVisible(true);
  //doesnt work
  </code></pre>
  
  <p>UserDetailWindowFrame is JFrame genereted by Netbeans.</p>