3 Replies Latest reply: Oct 18, 2012 2:56 AM by MiPa RSS

    Netbeans 7.2 - JavaFX Tutorial - problems with imports

    968780
      I am indeed a newbie. I installed Netbeans 7.2 and created a JavaFX Application project while following a tutorial. I inserted code (as instructed) for a GridPane with alignment and inset adjustments. After inserting the GridPane code from the tutorial, my build got errors (undefined for pos.Center and Insets
       
              GridPane grid = new GridPane();
              grid.setAlignment(Pos.CENTER);
              grid.setHgap(10);
              grid.setVgap(10);
              grid.setPadding(new Insets(25, 25, 25, 25));
      
              
      
      
              Scene scene = new Scene(grid, 300, 275);
              primaryStage.setScene(scene);
      {code}
      
      It took quite a long time for me to discover what includes to code in order to solve these build errors.  I eventually ended up with :
      
      {code}
      package login;
      
      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;
      import javafx.scene.layout.GridPane;
      import javafx.stage.Stage;
      import javafx.scene.Scene;
      import javafx.scene.text.Text;
      import javafx.scene.text.Font;
      ;
      import javafx.geometry.Insets;
      import javafx.application.Application;
      import javafx.geometry.Pos;
      import javafx.scene.Scene;
      import javafx.scene.control.PasswordField;
      import javafx.scene.layout.GridPane;
      import javafx.scene.layout.HBox;
      import javafx.scene.paint.Color;
      import javafx.scene.text.Font;
      import javafx.scene.text.FontWeight;
      import javafx.scene.text.Text;
      
      /**
      {code}
      
      The wizard produced these includes at the start:
      
      {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.layout.StackPane;
      import javafx.stage.Stage;
      {code}
      
      My questions:
      
      Is there a way to specify the includes for javaFX  with 
      {code}
      javafx.*;
      {code}
      
      Is there a simple way in Netbeans 7.2 to find out what include to use to solve the undefined build errors?