title: what is the difference between stackpane and root in javafx?
body: <p>I was practicing for javafx for doing pie chart. Following are the codes for developing pie chart. If i do with the <code>Group</code> and with the <code>StackPane</code>,I find no difference in the output.I have commented the Group part.Just wandering the difference between the two.</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.scene.Group;
  import javafx.scene.Scene;
  import javafx.scene.chart.PieChart;
  import javafx.scene.chart.PieChart.Data;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Stage;
  public class ChartApp1 extends Application {
  public static void main(String[] args) {
  launch(args);
  }
  @Override
  public void start(Stage primaryStage) {
  PieChart pieChart = new PieChart();
  //Group p=new Group();
  
  pieChart.setData(getChartData());
  primaryStage.setTitle("PieChart");
  StackPane root = new StackPane();
  root.getChildren().add(pieChart);
  //p.getChildren().add(pieChart);
  primaryStage.setScene(new Scene(root, 400, 250));
  primaryStage.show();
  }
  private ObservableList&lt;PieChart.Data&gt; getChartData() {
  ObservableList&lt;PieChart.Data&gt; answer = FXCollections.observableArrayList();
  answer.addAll(new PieChart.Data("java", 17.56),
  new PieChart.Data("C", 17.06),
  new PieChart.Data("C++", 8.25),
  new PieChart.Data("C#", 8.20),
  new PieChart.Data("ObjectiveC", 6.8),
  new PieChart.Data("PHP", 6.0),
  new PieChart.Data("(Visual)Basic", 4.76),
  new PieChart.Data("Other", 31.37));
  return answer;
  }
  }
  </code></pre>