diff -r 7a1db976a80b modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java Tue May 20 11:20:45 2014 +0200 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java Tue May 20 14:02:12 2014 +0200 @@ -756,32 +756,30 @@ hsb.setMin(control.getHmin()); hsb.setMax(control.getHmax()); - contentWidth = w; - contentHeight = h; - /* ** we want the scrollbars to go right to the border */ - double hsbWidth = contentWidth + padding.getLeft() + padding.getRight(); - double vsbHeight = contentHeight + padding.getTop() + padding.getBottom(); + double hsbWidth; + double vsbHeight; computeScrollNodeSize(contentWidth, contentHeight); computeScrollBarSize(); - vsbvis = determineVerticalSBVisible(); - hsbvis = determineHorizontalSBVisible(); - if (vsbvis) { - hsbWidth -= vsbWidth; - if (!IS_TOUCH_SUPPORTED) { - contentWidth -= vsbWidth; + for (int i = 0; i < 2; ++i) { + vsbvis = determineVerticalSBVisible(); + hsbvis = determineHorizontalSBVisible(); + + if (vsbvis && !IS_TOUCH_SUPPORTED) { + contentWidth = w - vsbWidth; } + hsbWidth = w + padding.getLeft() + padding.getRight() - (vsbvis ? vsbWidth : 0); + if (hsbvis && !IS_TOUCH_SUPPORTED) { + contentHeight = h - hsbHeight; + } + vsbHeight = h + padding.getTop() + padding.getBottom() - (hsbvis ? hsbHeight : 0); } - if (hsbvis) { - vsbHeight -= hsbHeight; - if (!IS_TOUCH_SUPPORTED) { - contentHeight -= hsbHeight; - } - } + + if (scrollNode != null && scrollNode.isResizable()) { // maybe adjust size now that scrollbars may take up space if (vsbvis && hsbvis) {