JScrollPane will not update
Hello,
I am working on a GUI application which displays event trees (looks kinda like NCAA basketball tournament brackets) and I am trying to implement a zooming feature where the user clicks on a spot on the tree and drags a box around the desired portion of the tree they want to see and the GUI only shows them the portion they selected. I am doing this somewhat manually right now, by comparing the dimensions of the box the user has drawn to the dimensions of the visible pane and applying scaling factors appropriately. The tree actually scales just fine, the PROBLEM occurs when I have to move my JScrollbars to the new locations (I resize everything and then move the scrollbars to match the upper left corner of the where the user selected). When I try and move the JScrollBars using:
JScrollPane pane = new JScollPane;
pane.getHorizontalScrollBar().setValue("newValuex");
pane.getVerticalScrollBar().setValue("newValuey");
In this process the JPanel which the JScrollPane is connected to gets resized to be much larger and if the "newValue"s are greater than the JPanel's original maximum sizes, the JScrollBars will scroll to those sizes and stop. It seems that I am not giving somethign enough time to update. I have even tried using SwingUtilities.invokeLater() with the .setValue() methods inside there but to no avail. Any advice. I am in a hurry writing this so if something is not clear please let me know and I will add more info. Thanks in advance.

