I have a BorderPane with a ScrollPane as the center element. It resizes automatically to fill the screen. Inside the ScrollPane is a <
BorderPane
ScrollPane
Setting the fitToHeight or fitToWidth attribute through XML or CSS:
fitToHeight
fitToWidth
XML
CSS
FXML:
CSS:
.my-scroll-pane { -fx-fit-to-height: true; -fx-fit-to-width: true; }