title: Setting the maximum size of a JDialog?
body: <p>The short version: do I need to do something tricky to get JDialog's setMaximumSize() to work?</p>
  
  <p>The full version:  I've got a JDialog (layout manager: BorderLayout) which contains a scroll pane and a JPanel on the bottom with the commit buttons.</p>
  
  <p>The scroll pane contains a JPanel which is built dynamically elsewhere in the system.</p>
  
  <p>What I want is for the dialog to dynamically size itself around the JPanel up to a certain size, and then start growing scrollbars.  This is, more or less, what happens by default, except the maximum size seems to be the size of my monitor.</p>
  
  <p>I <em>thought</em> this is what the .setMaximumSize() method inherited from java.awt.Component did, but setting it doesn't seem to have any effect.</p>
  
  <p>Setting the preferred size does has an effect - but then the dialog is always that size no matter what, which really isn't what I want.</p>
  
  <p>(And the effects are the same if I set the maximum/preferred size properties on the scroll pane.)</p>
  
  <p>Have I missed something tremendously obvious?  Is there some wacky JDialog / BorderLayout / MaximumSize interaction I don't know about?</p>