I am relatively new to JavaFx and I need help in getting a Vbox to grow as nodes are added to it.
I've place a VBox in a ScrollPane. The VBox gets filled with TitledPanes as they come in. But once the TitledPanes fill the space allotted the Vbox, the TitledPanes begin to overlap. Ideally I would want to Vbox to resize itself and use the ScrollPane to navigate.
I have the Vbox Max Height set to USE_COMPUTED_SIZE
. I've added a listener to the ScrollPane to listen to changes in size of the VBox but no luck. Any Suggestions?
scrollPane.vvalueProperty().addListener(new ChangeListener<Number>() {
public void changed(ObservableValue<? extends Number> ov,
Number old_val, Number new_val) {
vBox.setLayoutY(-new_val.doubleValue());
}
});
VBox
inside aScrollPane
theVBox
starts to grow as more and more children are added and theScrollPane
displays its scroll bar. – DVarga