This fixes the strange behavior of the scroll bars (not enough space to scroll provided after the tree expansion and the opposite (excess of space). Before computing the cached preferred size, we need update the current visible patch.

2006-01-27  Audrius Meskauskas  <[EMAIL PROTECTED]>

   * javax/swing/plaf/basic/BasicTreeUI.java (updateCachedPreferredSize):
   Call updateCurrentVisiblePath.

Index: BasicTreeUI.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v
retrieving revision 1.120
diff -u -r1.120 BasicTreeUI.java
--- BasicTreeUI.java	27 Jan 2006 10:16:28 -0000	1.120
+++ BasicTreeUI.java	27 Jan 2006 22:20:39 -0000
@@ -1237,6 +1237,7 @@
   protected void updateCachedPreferredSize()
   {
     int maxWidth = 0;
+    updateCurrentVisiblePath();    
     boolean isLeaf = false;
     if (currentVisiblePath != null)
       {

Reply via email to