title: How to adjust a JScrollPane to its contained JTree
body: <p>here I have a swing size question:</p>
  
  <p>I have a <code>JTree</code> which is contained inside a <code>JScrollPane</code> (<em>which is contained in a custom component which extends JXPanel from swingx, but I think that has nothing to do with this question</em>).</p>
  
  <p>Doesn't matter how many rows the tree has, the scrollpane is always bigger (the tree is dinamic but not designed to have many rows) but what I would like is the JScrollPane to adjust to the tree initial height and then show the vertical scroll when some of the nodes are expanded.</p>
  
  <p>I have tried without setting any size at all, setting tree <code>preferred size to null</code> and setting scrollpane <code>preferred size to null</code> as well but nothing changes. <strong>I DO NOT WANT</strong> to set the size manually... Is there a way to do this?</p>
  
  <p>Thanks</p>