I'm developing a JavaFX application for kids to control a little robot, the kid would define the commands throught Drag-n-Drops command blocks. The target area is a Scrollpane with a VBox.
I would like to know if there is any way to make the ScrollPane and VBox autoresizable, thus when I add a node to the Green block it must grow (aldeady doing) and when I remove a node from Green block it must shrink.
Here is the code:
// Set to BorderPane#Center<br/>
boxCode = new VBox(0.0);
boxCode.setMinSize(400, 80);
// here I also set MaxSize using Double.MAX_VALUE and USE_COMPUTED_SIZE
paneCode = new ScrollPane(boxCode);
paneCode.setMinSize(400, 80);
paneCode.setStyle("-fx-background-color:transparent;");
paneCode.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
layout.setCenter(paneCode);
Here is my project: GitHub - Programming Block
Thank you!