<div dir="ltr">Hi,<br><div><br></div><div>I took a quick jab at this issue [1]. Using the reproducer in the ticket, launch and resize the stage vertically so that the buttons at the bottom are only partially visible.</div><div><br></div><div>The current behavior is as follows:</div><div>When the scrollbar is not needed, toggling to the AS_NEEDED policy reallocates the scrollbar space for the buttons (they move up).</div><div>When the scrollbar is needed, toggling to the AS_NEEDED policy still reallocates space, and the scrollbar takes away space from the content node. This is wrong.</div><div><br></div>I modified the method 'computeHsbSizeHint' to<div><br><div>private double computeHsbSizeHint(ScrollPane sp) {<br>    return determineHorizontalSBVisible() ? hsb.prefHeight(ScrollBar.USE_COMPUTED_SIZE) : 0;<br>}</div><div><br></div><div>Now the policy toggling behavior is correct both when the scrollbar is needed and when it's not - the space is reallocated not at the expense of the content. However, enlarging the stage horizontally while AS_NEEDED is selected does not reallocate the space (you need to toggle the policies). I'm guessing there's a missing call to layoutChildren during this resizing.<br></div><div><br></div><div>Does anyone have any input here?<br><div style="background-color:rgb(47,47,47);padding:0px 2px"><div style="color:rgb(170,170,170);font-family:Consolas;font-size:11pt;white-space:pre"><p style="background-color:rgb(55,55,55);margin:0px"><span style="color:rgb(217,232,247)"></span></p></div></div><div><br></div><div>Thanks,</div><div>Nir</div><div><br></div><div>[1] <a href="https://bugs.openjdk.org/browse/JDK-8199934">https://bugs.openjdk.org/browse/JDK-8199934</a><br></div><div><br></div></div></div></div>