Ok. I see that you add the JScollPane (that has the JTree) to a JPanel named pane2 (I assume pane2 is a JPanel as you have not provided that info).
If so, what is the LayoutManager used for that JPanel? You are adding a new JScrollPane. What about the old one. Should you not remove it first?
Also, why are you using setBounds? I don't think it is needed. Ideally,
you should have this pane2 use a BorderLayout with the JScollPane added to the center.
In fact, you should update the tree's model rather than create a new JTree everytime.