title: Failed to load FXML file in JavaFX
body: <p>So as I'm trying to do the tutorials for JavaFX and am working on the FXML example. But whenever I add something to the GridPane in the .fxml file the program crashes. It opens a normal GridPane if nothing else is put in it.</p>
  
  <p>Code For the FXML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import java.net.*?&gt;
  &lt;?import javafx.geometry.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.text.*?&gt;
  
  &lt;GridPane fx:controller="fxmlexample.FXMLExampleController" 
      xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10"&gt;
  &lt;padding&gt;&lt;Insets top="25" right="25" bottom="10" left="25"/&gt;&lt;/padding&gt;
  &lt;Text text="Welcome" 
          GridPane.columnIndex="0" GridPane.rowIndex="0"
          GridPane.columnSpan="2"/&gt;
  
      &lt;Label text="User Name:"
          GridPane.columnIndex="0" GridPane.rowIndex="1"/&gt;
  
      &lt;TextField 
          GridPane.columnIndex="1" GridPane.rowIndex="1"/&gt;
  
      &lt;Label text="Password:"
          GridPane.columnIndex="0" GridPane.rowIndex="2"/&gt;
  
      &lt;PasswordField fx:id="passwordField" 
          GridPane.columnIndex="1" GridPane.rowIndex="2"/&gt;
  &lt;/GridPane&gt;
  </code></pre>
  
  <p>Code for the main class:</p>
  
  <pre><code>package fxmlexample;
  
  import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.stage.Stage;
  
  public class FXMLExample extends Application {
  
  public static void main(String[] args) {
      Application.launch(FXMLExample.class, args);
  }
  
  @Override
  public void start(Stage stage) throws Exception {
      Parent root = FXMLLoader.load(getClass().getResource("fxml_example.fxml"));
  
      Scene scene = new Scene(root, 300, 275);
  
      stage.setTitle("FXML Welcome");
      stage.setScene(scene);
      stage.show();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>What exactly is causing it to crash?</p>