title: Adding panel to BorderLayout region, elements not wrapping as they should
body: <p>So I have some code like this inside <code>init()</code> for an applet:</p>
  
  <pre><code>layout = new BorderLayout();
  setLayout(layout);
  
  northPanel = new JPanel(new FlowLayout());
  
  northPanel.add(inputDropDown);
  northPanel.add(lowBoundLabel);
  northPanel.add(lowBoundField);
  northPanel.add(highBoundLabel);
  northPanel.add(highBoundField);
  northPanel.add(new JLabel("using"));
  northPanel.add(categoriesField);
  northPanel.add(new JLabel("categories"));
  northPanel.add(showTotalsBox);
  northPanel.add(refreshButton);
  
  add(northPanel, BorderLayout.NORTH);
  </code></pre>
  
  <p>Now when I test it, all of the elements are in a straight line and do not wrap around when there is not enough space. I even made sure to specify that the panel is <code>FlowLayout</code> (even though it's the default) and it didn't change anything. </p>
  
  <p>Shouldn't they wrap instead of just going off the screen? What's going on? I came up with a temporary solution by changing the <code>northPanel</code> to <code>BorderLayout</code>, splitting up these elements into to separate panels and adding them to <code>North</code> and <code>South</code>. However, the elements just disappear off the screen without the necessary space in this method so I'd rather have them wrap around.</p>