Recommended fix to your sample FXML:
- Don't set
vmax
on the vertical scroll. - Add in more content (e.g. more labels), so there is actually something to scroll.
- Don't place the VBox holding your scrollable content inside an AnchorPane.
Try this version:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<ScrollPane layoutX="100.0" layoutY="52.0" pannable="false" prefHeight="200.0" prefWidth="200.0">
<VBox prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<Label text="Label">
<font>
<Font size="50.0" fx:id="x1" />
</font>
</Label>
<Label font="$x1" text="Label" />
<Label font="$x1" text="Label" />
<Label font="$x1" text="Label" />
<Label font="$x1" text="Label" /><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/><Label font="$x1" text="Label"/>
</VBox>
</ScrollPane>
</AnchorPane>