title: File Location and Unknown Error JAVAFX
body: <p>I am trying to construct a basic UI with javafx and i have done this several time before. For some reason i have encountered this:</p>
  
  <pre><code>Exception in Application start method
  java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
  at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
  Caused by: java.lang.RuntimeException: Exception in Application start method
  at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
  at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
  at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.NullPointerException: Location is required.
  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3207)
  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
  at Main.Main.start(Main.java:18)
  at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
  at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
  at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
  at java.security.AccessController.doPrivileged(Native Method)
  at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
  at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
  at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
  ... 1 more
  </code></pre>
  
  <p>Exception running application Main.Main</p>
  
  <p>I don't understand what i am doing wrong as this has never happened to me and i have repeated this process in the same way as to previous.
  Photo of eclipse layout:
  <a href="https://gyazo.com/b77d2ceace61eef8ed2526686f6763f0?token=d3f747ca001b7e411d721c12cd54b46a" rel="nofollow noreferrer">https://gyazo.com/b77d2ceace61eef8ed2526686f6763f0?token=d3f747ca001b7e411d721c12cd54b46a</a> 
  Code:
  Main.java:</p>
  
  <pre><code>package Main;
  
  import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Scene;
  import javafx.scene.layout.Pane;
  import javafx.stage.Stage;
  
  public class Main extends Application {
  
  
  public static void main(String[] args) {
      launch(args);
  }
  
  @Override
  public void start(Stage primaryStage) throws Exception {
      Pane mainPane = (Pane) FXMLLoader.load(Main.class.getResource("Main.fxml"));
      primaryStage.setScene(new Scene(mainPane));
      primaryStage.show();
  }
  }
  </code></pre>
  
  <p>myController.java:</p>
  
  <pre><code>package Main;
  
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.scene.control.Button;
  import javafx.scene.control.ComboBox;
  import javafx.scene.control.Label;
  import javafx.scene.control.ScrollBar;
  import javafx.scene.control.TextField;
  
  public class myController {
  
  @FXML
  private TextField quantity;
  
  @FXML
  private Button adding;
  
  @FXML
  private ScrollBar currentP;
  
  @FXML
  private Label message;
  
  @FXML
  private ComboBox&lt;?&gt; stocks;
  
  @FXML
  private Button remove;
  
  @FXML
  void itemPicked(ActionEvent event) {
  
  }
  
  @FXML
  void getIndexC(ActionEvent event) {
  
  }
  
  @FXML
  void deleteItem(ActionEvent event) {
  
  }
  
  @FXML
  void addItem(ActionEvent event) {
  
  }
  
  @FXML
  void getQuantity(ActionEvent event) {
  
  }
  
  }
  </code></pre>
  
  <p>Main.fxml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import java.net.*?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.image.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.shape.*?&gt;
  &lt;?import javafx.scene.text.*?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  
  &lt;Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" stylesheets="@myStyle.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="myController"&gt;
     &lt;children&gt;
        &lt;ImageView fitHeight="568.0" fitWidth="684.0" layoutX="356.0" layoutY="167.0" pickOnBounds="true" preserveRatio="true"&gt;
           &lt;image&gt;
              &lt;Image url="@../../../Pictures/builder.jpg" /&gt;
           &lt;/image&gt;
        &lt;/ImageView&gt;
        &lt;ImageView fitHeight="885.0" fitWidth="857.0" layoutX="629.0" layoutY="187.0" pickOnBounds="true" preserveRatio="true" rotate="90.0"&gt;
           &lt;image&gt;
              &lt;Image url="@../../../Pictures/Uroburos-rootkit-Espionage-Russia.jpg" /&gt;
           &lt;/image&gt;
        &lt;/ImageView&gt;
        &lt;ImageView fitHeight="885.0" fitWidth="857.0" layoutX="-187.0" layoutY="187.0" pickOnBounds="true" preserveRatio="true" rotate="90.0"&gt;
           &lt;image&gt;
              &lt;Image url="@../../../Pictures/Uroburos-rootkit-Espionage-Russia.jpg" /&gt;
           &lt;/image&gt;
        &lt;/ImageView&gt;
        &lt;Line endX="100.0" endY="400.0" layoutX="381.0" layoutY="324.0" startX="100.0" startY="-325.0" /&gt;
        &lt;Line endX="425.0" endY="390.0" layoutX="391.0" layoutY="334.0" startX="425.0" startY="-335.0" /&gt;
        &lt;ComboBox fx:id="stocks" layoutX="38.0" layoutY="135.0" onAction="#itemPicked" prefHeight="46.0" prefWidth="421.0" promptText="Please Select and Item" /&gt;
        &lt;ScrollBar fx:id="currentP" layoutX="857.0" layoutY="108.0" onDragDetected="#getIndexC" orientation="VERTICAL" prefHeight="100.0" prefWidth="400.0" /&gt;
        &lt;Button fx:id="remove" layoutX="1007.0" layoutY="53.0" mnemonicParsing="false" onAction="#deleteItem" prefHeight="43.0" prefWidth="250.0" text="Remove From Order"&gt;
           &lt;font&gt;
              &lt;Font name="Arial Black" size="20.0" /&gt;
           &lt;/font&gt;
        &lt;/Button&gt;
        &lt;ImageView fitHeight="72.0" fitWidth="79.0" layoutX="491.0" layoutY="74.0" pickOnBounds="true" preserveRatio="true"&gt;
           &lt;image&gt;
              &lt;Image url="@../../../Pictures/Uroburos-rootkit-Espionage-Russia.jpg" /&gt;
           &lt;/image&gt;
        &lt;/ImageView&gt;
        &lt;Label layoutX="491.0" layoutY="14.0" prefHeight="60.0" prefWidth="311.0" text="RootKit At your Service" textAlignment="JUSTIFY"&gt;
           &lt;font&gt;
              &lt;Font name="Courier New Bold Italic" size="22.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Label fx:id="message" layoutX="587.0" layoutY="87.0" text="&amp;quot;Protecting&amp;quot; your trade"&gt;
            &lt;font&gt;
              &lt;Font name="Courier New Italic" size="15.0" /&gt;
            &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Button fx:id="adding" layoutX="38.0" layoutY="81.0" mnemonicParsing="false" onAction="#addItem" text="Add Item To Order"&gt;
           &lt;font&gt;
              &lt;Font name="Arial Black" size="20.0" /&gt;
           &lt;/font&gt;
        &lt;/Button&gt;
        &lt;TextField fx:id="quantity" layoutX="38.0" layoutY="194.0" onAction="#getQuantity" prefHeight="54.0" prefWidth="62.0" promptText="&amp;quot;1&amp;quot;"&gt;
           &lt;font&gt;
             &lt;Font size="20.0" /&gt;
           &lt;/font&gt;&lt;/TextField&gt;
        &lt;Label layoutX="108.0" layoutY="196.0" text="Quantity" textFill="WHITE"&gt;
           &lt;font&gt;
              &lt;Font name="Arial Black" size="34.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
     &lt;/children&gt;
  &lt;/Pane&gt;
  </code></pre>
  
  <p>CSS File is currently empty.
  I want to overall get the GUI displaying but for some reason the location is not found and for some reason i have another error which i cannot even identify.
  Thanks for all help in advance &lt;3</p>