Index: javax/swing/ViewportLayout.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/ViewportLayout.java,v retrieving revision 1.13 diff -u -r1.13 ViewportLayout.java --- javax/swing/ViewportLayout.java 2 Jul 2005 20:32:49 -0000 1.13 +++ javax/swing/ViewportLayout.java 1 Sep 2005 17:20:07 -0000 @@ -69,7 +69,11 @@ JViewport vp = (JViewport)parent; Component view = vp.getView(); if (view != null) - return view.getPreferredSize(); + { + if (view instanceof Scrollable) + return ((Scrollable)view).getPreferredScrollableViewportSize(); + return view.getPreferredSize(); + } else return new Dimension(); } @@ -120,7 +124,7 @@ JViewport port = (JViewport) parent; Component view = port.getView(); - + if (view == null) return; @@ -139,7 +143,8 @@ if (portBounds.height >= viewMinimum.height) { portBounds.y = 0; - viewPref.height = portBounds.height; + if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) + viewPref.height = portBounds.height; } else { @@ -153,7 +158,8 @@ if (portBounds.width >= viewMinimum.width) { portBounds.x = 0; - viewPref.width = portBounds.width; + if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) + viewPref.width = portBounds.width; } else {