title: Expandable panel with layering
body: <p>I've trying to get two <code>JPanel</code>s to layer on top of one another, but at the same time, expand to fit the size of their parent. For example, if the <code>JFrame</code> that contains the two layered <code>JPanel</code>s is expanded, the layered <code>JPanel</code>s also expand to fill the entire <code>JFrame</code>, and vice-versa when the <code>JFrame</code> is collapsed.</p>
  
  <p>The idea is to create a top layer that contains buttons and other Swing components that control a bottom layer, but the bottom layer can still be seen through the top layer (by setting the top layer's properties to <code>setOpaque(false)</code>). At the same time, both the top and the bottom layers should fill the available size of their container (the <code>JPanel</code> or <code>JFrame</code> that contains the layers).</p>
  
  <p>I have already tried working with <code>JLayeredPane</code>, but the size of the pane must be known in advanced (as far I have been able to get it working so far). These size constraints will change as the size of the containing <code>JPanel</code> or <code>JFrame</code> change.</p>
  
  <p>Thank you in advanced for your help.</p>