title: JavaFX: autoresize stage after adding child to root parent
body: <p>I need to show a <code>Panel</code> with an extra options in the same <code>Scene</code> when I click on the <code>Button</code>, but I've no idea how to achieve this behaviour. The problem that the <code>Stage</code> not resizing when I add panel to root <code>VBox</code>. </p>
  
  <p>I've written simple code to demonstrate the problem.</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.event.ActionEvent;
  import javafx.event.EventHandler;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.Label;
  import javafx.scene.layout.VBox;
  import javafx.stage.Stage;
  
  public class Main extends Application {
     public static void main(String[] args) {
         launch(args);
     }
  
     public void start(Stage stage) throws Exception {
         final VBox root = new VBox();
         Button button = new Button("add label");
         root.getChildren().add(button);
  
         button.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
             public void handle(ActionEvent event) {
                 root.getChildren().add(new Label("hello"));
             }
         });
  
         stage.setScene(new Scene(root));
         stage.show();
     }
  }
  </code></pre>
  
  <p>I suppose I need to call some method to notify root container to do layout, but all methods I try haven't brought me desired results.</p>