I'm learning JavaFX through the Oracle Tutorial and I'm confused about this particular topic. I seem to be the only one confused as my searching hasn't led to any helpful results. I'm creating a basic GridPane with 2 columns (0,1) and 3 rows (0,1,2). In the first row I have the title, and the other two rows have a label on the left and a text box on the right -- it's a login screen
LOGIN
username | [_______]
password | [_______]
Here's the code for populating the grid:
Text scenetitle = new Text("Login");
scenetitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
grid.add(scenetitle,0,0,2,1); // Row span here is set to 1
Label userName = new Label("User Name");
grid.add(userName,0,1);
TextField userTField = new TextField();
grid.add(userTField,1,1);
Label passName = new Label("Password");
grid.add(passName,0,2); // Here I'm referencing a row index of 2
TextField passTField = new TextField();
grid.add(passTField,1,2)
The code works perfectly, as it's basically just a copy-paste from the tutorial. However, my confusion comes from the fact that I have a row span of 1, but I'm referencing a row index of 2. I tried switching the row and column span but that messed it up, so I'm sure this is correct. What am I missing?