title: Java/Swing: How to correctly using FlowLayout to add multiple JPanels on a JFrame?
body: <p>I want to add two JPanels in a JFrame, I tryied this:</p>
  
  <pre><code>JPanel container;
  JPanel jp;
  JPanel jp2;
  FlowLayout layout = new FlowLayout(FlowLayout.CENTER);
  container.setLayout(layout);
  jp = new Drawing();
  jp2= new Drawing2();
  container.add(jp);
  container.add(jp2);
  setContentPane(container)
  setVisible(true);
  </code></pre>
  
  <p>container.setLayout gives me </p>
  
  <blockquote>
    <p>java.lang.NullPointerException</p>
  </blockquote>
  
  <p>Can you help me please? Thanks you.</p>