Index: javax/swing/ViewportLayout.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/ViewportLayout.java,v retrieving revision 1.19 diff -u -r1.19 ViewportLayout.java --- javax/swing/ViewportLayout.java 6 Dec 2005 14:31:09 -0000 1.19 +++ javax/swing/ViewportLayout.java 12 Dec 2005 13:22:42 -0000 @@ -146,11 +146,7 @@ // vertical implementation of the above rules if (portBounds.height >= viewMinimum.height) - { - portBounds.y = 0; - if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) - viewPref.height = portBounds.height; - } + portBounds.y = 0; else { int overextension = portLowerRight.y - viewPref.height; @@ -158,13 +154,13 @@ portBounds.y -= overextension; } + if ( !(view instanceof Scrollable) + || ((Scrollable)view).getScrollableTracksViewportHeight()) + viewPref.height = portBounds.height; + // horizontal implementation of the above rules if (portBounds.width >= viewMinimum.width) - { - portBounds.x = 0; - if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) - viewPref.width = portBounds.width; - } + portBounds.x = 0; else { int overextension = portLowerRight.x - viewPref.width; @@ -172,12 +168,10 @@ portBounds.x -= overextension; } + if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) + viewPref.width = portBounds.width; + port.setViewPosition(portBounds.getLocation()); - // TODO: I doubt that the size should really be touched here, except when - // the view is somehow smaller than its minimumSize. I would think that - // when the size of a view is set manually to a fixed value, that this - // value should be left unchanged, and not reset to the preferred or - // minimum size. -- Roman Kennke port.setViewSize(viewPref); } }