When ScrollBar has ScrollBarPolicy.NEVER set on one side, and ScrollBarPolicy.AS_NEEDED on the other, it is expected that its preferred size would account for appearing/disappearing scroll bar when the available space changes.
To reproduce, run the attached code and manually reduce the window height.
Notice that the left edge of the label with the red border does not shift when the vertical scroll bar appears, and also how the vertical scroll bar overlaps the label and its right border.
To reproduce, run the attached code and manually reduce the window height.
Notice that the left edge of the label with the red border does not shift when the vertical scroll bar appears, and also how the vertical scroll bar overlaps the label and its right border.
- relates to
-
JDK-8313709 Wrong layout of a FlowPane in a BorderPane in a ScrollPane, if padding is too big
- Open