title: What is the difference between adding an element to a JFrame as opposed to a Container?
body: <p>The code is:</p>
  
  <pre><code>JFrame jframe = new JFrame("no difference");
  JButton button = new JButton("no difference");
  jframe.getContentPane().add(button); 
  // the same result occurs for
  jframe.add(button);
  </code></pre>
  
  <p><code>getContentPane</code> returns a <code>Container</code> object. What is the point of adding button to the Container if it works equally well with the JFrame? Why bother coding <code>jframe.getContentPane().add(button);</code> if we can do <code>jframe.add(button);</code> </p>