title: Move two JPanel inside of a MainFrame, when those JPanels have an Absolut Layout
body: <p>I have added two JPanels inside my MainFrame. The problem I am having is that one frame appears on top of another. How can I fix the size so I move one of the panels down.</p>
  
  <pre><code>public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      MainFrame frame = new MainFrame();
  
  
                      Panel1 panel1= new Panel1();
                      Panel2 panel2= new Panel2();
  
                      frame.getContentPane().add(panel1.contentPanel);
                      frame.getContentPane().add(panel2.contentPanel);
  
  
  
                      frame.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  </code></pre>
  
  <p>The complication is that both of this JPanels I have:</p>
  
  <pre><code>  Panel1.java
    contentPanel.setLayout(null);
  
    Panel2.java
    contentPanel.setLayout(null);
  </code></pre>
  
  <p>I don't want to use a GridBagLayout in the Mainframe, because I want to achieve this using an Absolute Layout.</p>
  
  <p>I want to move the Panel2 down, so it appears Panel1 on top of Panel2.</p>