I created a GridPane in my JFX Fluidon Designer and I'm trying to reference it in one of my java files.
More specifically, I'd like to programatically put it inside a Vbox with an Hbox I also created in Java. I'll post the code below, it might make more sense.
When I run this code, I get an error that my gridPane variable is null when I use it in the addAll method.
Thanks in advance!
public class MyProgram extends Application {
Label mStatus;
ImageView img_x;
ImageView img_o;
@FXML public GridPane gridPane;
@Override
public void start(Stage primaryStage) {
BorderPane root = new BorderPane();
img_x = new ImageView("file:x.png");
img_o = new ImageView("file:o.png");
img_x.setUserData("X");
img_o.setUserData("O");
HBox hbox = new HBox();
hbox.getChildren().addAll(img_x, img_o);
VBox vbox = new VBox();
vbox.getChildren().addAll(hbox, gridPane);
root.setCenter(vbox);