I add some child nodes to a VBox, such as button and text. So, the VBox's width should be larger than 0, as it's showing on the scene.
But when I call the width value, it prints out 0.
Examples:
vbox.getWidth(); // prints 0
vbox.widthProperty(); // prints 0
How do I get the right width of vbox
?