title: javafx how to expand entire treeItem on button click event?
body: <p>In Javafx, How to expand entire treeItem on button click event ?</p>
  
  <p>I am trying to replicate accordion effect using TreeItem due to some issues in scrolling while using accordion. Please look at my code snippet below-</p>
  
  <pre><code>final TreeItem&lt;FlowPane&gt; rootItem = new TreeItem&lt;&gt;();
  root.setExpanded(true);
  for (int i = 0; i &lt; 12; i++) {
      TreeItem&lt;FlowPane&gt; rootItem1 = new TreeItem&lt;&gt;(miniflowPane());
      TreeItem&lt;FlowPane&gt; item1 = new TreeItem&lt;&gt;(flowPaneLarge());
      rootItem1.getChildren().add(item1);
      rootItem.setExpanded(false);
  }
  final TreeView&lt;FlowPane&gt; tree;
  tree = new TreeView&lt;&gt;(rootItem);
  tree.setShowRoot(false);
  tree.setMinWidth(450.0);
  tree.setMaxWidth(450.0);
  HBox listHeaderBox = new HBox();
  listHeaderBox.setAlignment(Pos.CENTER_LEFT);
  Button b = new Button("&gt;");
  b.setOnAction(new EventHandler&lt;ActionEvent&gt;() {        
  @Override
   public void handle(ActionEvent event) {
  
   }
   });
   listHeaderBox.getChildren().add(b);
   VBox listVBox = new VBox(5.0);
   listVBox.getCHildren().addAll(listHeaderBox,tree);
   Scene scene = new Scene(listVBox,500,650);
   primartStage.setScene(scene);
   primaryStage.show();
  }
  </code></pre>
  
  <p>miniflowPane() and flowPane() functions creates some dummy contents and returns FlowPane. In Button b's click event, how to expand all the children and grandchildren of rootItem ?</p>