@permalmberg For containers, there is a set of static methods like VBox.setVGrow( node, Priority) which sets out rules for how extra space is distributed. For example, a Toolbar might be set to Priority.NEVER and a main content pane set to Priority.ALWAYS. If there is extra space, all of the space will be directed to the main content pane.
I'm not aware of any similar behavior for Shapes. You can use binding as in this example. Two Rectangles stretch to fill the available width and each fills half the available height.