title: JavaFX View: Is there a difference between add and setConstraints?
body: <p>Is there a difference between add() or setConstraints and so yes is a what is, Preference or really a big difference?</p>
  
  <pre><code>public class example extends Application {
  
  
      @Override
      public void start(Stage primaryStage) throws Exception {
          primaryStage.setTitle("Example");
          GridPane grid = new GridPane();
  
          Label label = new Label("Example A");
          Label label2 = new Label("Example B");
  
          grid.add(label, 0,0);
  
          GridPane.setConstraints(label2, 1, 0);
          grid.getChildren().add(label2);
  
          Scene scene = new Scene(grid, 300,200);
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  } 
  </code></pre>