title: Java - setVisible(true) has no effect on GUI
body: <p>I created a GUI (called ParameterUI) with the Netbeans GUI Builder and now I want to create an instance of it and display it. However, using </p>
  
  <pre><code>ParameterUI gui = new ParameterUI();
  gui.setVisible(true);
  </code></pre>
  
  <p>doesn't cause any window to appear...
  Testing shows that after those commands, gui.isVisible() returns true, but gui.isValid() is false. Calling gui.revalidate() has no effect either. </p>
  
  <p>In the ParameterUI class, the constructor method is generated by Netbeans and is simply</p>
  
  <pre><code>public class ParameterUI extends javax.swing.JPanel {
      public ParameterUI() {
          initComponents();
      }
  }
  </code></pre>
  
  <p>initComponents is simply a listing of where each jPanel etc. will be placed.</p>
  
  <p>The strange thing is that when I made a practice GUI with the tutorial at <a href="http://netbeans.org/kb/docs/java/gui-functionality.html" rel="nofollow noreferrer">http://netbeans.org/kb/docs/java/gui-functionality.html</a> , the GUI was set as the main class despite having no main method and the GUI appeared of its own accord.</p>
  
  <p>Unfortunately I'm a novice with GUIs (I'm using the builder cause I haven't got time to learn how to make a proper hand-made GUI), but can someone tell me how to make my GUI visible? I can provide more code if necessary...</p>
  
  <p>EDIT: I tried</p>
  
  <pre><code>JFrame window = new JFrame();
  ParameterUI gui = new ParameterUI();
  window.setContentPane(gui);
  window.pack();
  window.setVisible(true);
  </code></pre>
  
  <p>having read a short tutorial on JFrames, but it doesn't seem to change anything...</p>