title: JAVA: Ways to fill a Frame. add(), setContentPane(), getContentPane()
body: <p>I found three ways to fill my JFrame frame = new JFrame("...")
  createContentPanel returns a JPanel and createToolBar returns a ToolBar.</p>
  
  <pre><code>frame.add(this.createToolBar(), BorderLayout.PAGE_START); //this works and puts the ToolBar above and the ContentPanel under it&lt;br&gt;
  frame.add(this.createContentPanel(), BorderLayout.CENTER);
  
  frame.setContentPane(this.createContentPanel()); //this lets the JToolBar hover over the ContentPanel
  frame.getContentPane().add(this.createToolBar()); 
  
  frame.getContentPane().add(this.createContentPanel()); //this only puts the last one into the JFrame
  frame.getContentPane().add(this.createToolBar());
  </code></pre>
  
  <p>And now I am wondering why should i use the getContentPane()/setContentPane() method if i could just use a simple frame.add(...) to fill my frame.</p>