title: Insert a swing custom form into another custom form
body: <p>I've created 2 custom forms with netbeans GUI builder:</p>
  
  <ul>
  <li><p>the 1st one is a JPanel with several JPanel and components in it and an empty JPanel (JPanel1) in the middle.</p></li>
  <li><p>the 2nd is a JPanel Form with some components in it (jbutton,etc...).</p></li>
  </ul>
  
  <p>What I'd like to do is to insert the 1st form into a JFrame (that I succeed) and then everytime I click a button on the first form it inserts the second form into the empty JPanel of the first form. I failed on this second part.</p>
  
  <p>I won't post the entire code here as it is mostly generated by netbeans but here's the <code>actionperformedevent</code> on the button of first form and the test JFrame class I wrote:</p>
  
  <pre><code>public class TABLE_1 extends javax.swing.JPanel {
  
      /**
       * Creates new form TABLE
       */
      public TABLE_1() {
          initComponents();
  
      }
  private void jButton29ActionPerformed(java.awt.event.ActionEvent evt) {
  
          jPanel1.setLayout(new FlowLayout()); //empty Jpanel of 1st form
          LigneProduit2 p1 = new LigneProduit2(); //p1 is the 2nd form(JPanel)
          jPanel1.add(p1);
  }
  
  
  public class TABLE extends JFrame{
  
  
      public static void main(String[] args) {
  
          JFrame j1 = new JFrame();
          TABLE_1 t1 = new TABLE_1(); // 1st form
          j1.add(t1);
          j1.pack();
          j1.setVisible(true);
  }
  </code></pre>
  
  <p>So yeah, p1 doesn't show up in t1...</p>