@Override protected void layoutChildren() { double layoutWidth = getLayoutBounds().getWidth(); double layoutHeight = getLayoutBounds().getHeight(); boolean vbarVisible = vbar.isVisible(); boolean hbarVisible = hbar.isVisible(); double vbarWidth = vbarVisible ? vbar.prefWidth(-1) : 0; double hbarHeight = hbarVisible ? hbar.prefHeight(-1) : 0; double w = layoutWidth - vbarWidth; double h = layoutHeight - hbarHeight; content.resize(w, h); hbar.setVisibleAmount(w); vbar.setVisibleAmount(h); if(vbarVisible) { vbar.resizeRelocate(layoutWidth - vbarWidth, 0, vbarWidth, h); } if(hbarVisible) { hbar.resizeRelocate(0, layoutHeight - hbarHeight, w, hbarHeight); } }