By setting preferred size on the panel you are also restricting how big it can become... this isn't what you want to do.
Just add the tree as the main component in the scroll pane, not a panel holding the tree. I'm not clear on why you are trying to specify a width... if you just add the tree to the scroll pane, the scrollpane automatically knows the largest width to let you scroll to be able to see the tree. If you are trying to make the scrollpane wider, set the preferred size on the scroll pane instead of the tree...
Write once, run anywhere, because there's nowhere to hide! - /. A.C.