title: I can't add multiple swing components to jframe
body: <p>I'm creating this simple GUI with Swing, but I can't add multiple Swing components. If I add a component with <code>frame.getContentPane().add(component)</code>, and there already is a component added, it hides the first component and displays the second. I'm new to Swing and don't know how to fix this problem. I've tried reversing the order of the adding, but it still showed only the second component added. Here's some of my code:</p>
  <pre class="lang-java prettyprint-override"><code>JFrame frame = new JFrame(&quot;Title&quot;);
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  JLabel headerHTML = new JLabel(&quot;&lt;html&gt;&lt;h1 style='font-size: 50px; border-bottom: 2px solid black'&gt;Header&lt;/h1&gt;&lt;/html&gt;&quot;);
  ImageIcon logoImage = new ImageIcon(&quot;img/logo.png&quot;);
  JLabel logo = new JLabel(logoImage);
  frame.getContentPane().add(headerHTML);
  frame.getContentPane().add(logo);
  frame.pack();
  frame.setVisible(true);
  </code></pre>
  <p>That displays the <code>logo</code> JLabel but not the <code>headerHTML</code> JLabel. How can I display both JLabels in order?</p>