title: NullPointerException (JavaFX Label.setText())
body: <p>I got problem with my javaFx application. Everytime I call the .setText() method of my Label, I get a NullPointerException. Here is my code:
  This is a snnippet of my Controller:</p>
  
  <pre><code>public class HomenizerController implements Initializable{
  //ArrayList zum abspeichern der Termine in Listen Form
  private ArrayList&lt;Date&gt; dateList = new ArrayList();
  //ArrayList zum ab speichern der Aufgaben in Listen Form
  private ArrayList&lt;ToDo&gt; toDoList = new ArrayList();
  private Properties prop = null;
  
  @FXML private Label username;
  
  private void setWelcomeTab(){
      username.setText("A");
  }
  
  private void loadProperties(String path){
      FileInputStream fis = null;
      try {
          prop = new Properties();
          fis = new FileInputStream("src/homenizer/profiles/"+path+"/config.properties");
          prop.load(fis);
      } catch (FileNotFoundException ex) {
          Logger.getLogger(HomenizerController.class.getName()).log(Level.SEVERE, null, ex);
      } catch (IOException ex) {
          Logger.getLogger(HomenizerController.class.getName()).log(Level.SEVERE, null, ex);
      } finally {
          try {
              if(fis != null)
                  fis.close();
          } catch (IOException ex) {
              Logger.getLogger(HomenizerController.class.getName()).log(Level.SEVERE, null, ex);
          }
      }
  
  }
  
  public void startHomenizer(Stage stage, String username) throws IOException{
          Parent root = FXMLLoader.load(getClass().getResource("/homenizer/view/HomenizerView.fxml"));
          Scene scene = new Scene(root,1100,650);
          stage.setResizable(true);
          stage.setTitle("Homenizer");
          stage.setScene(scene);
          stage.show();
          loadProperties(username);
          setWelcomeTab();
  
      }
  
    @Override
     public void initialize(URL url, ResourceBundle rb) {
     // TODO
     } 
  </code></pre>
  
  <p>And here is my .fxml:</p>
  
  <pre><code>&lt;center&gt;
      &lt;TabPane fx:id="tabPan"&gt;
          &lt;Tab text="Willkommen" closable="true" &gt; 
              &lt;VBox&gt;
                  &lt;TitledPane text="Allgemeines" expanded="true"&gt;
                      &lt;GridPane&gt;
                          &lt;Label text="Benutzername:" GridPane.columnIndex="0" GridPane.rowIndex="0" /&gt;
                          &lt;Label fx:id="username" GridPane.columnIndex="1" GridPane.rowIndex="0" /&gt;
                          &lt;Label text="Termine gesamt:" GridPane.columnIndex="0" GridPane.rowIndex="1" /&gt;
                          &lt;Label fx:id="dates" GridPane.columnIndex="1" GridPane.rowIndex="1" /&gt; 
                          &lt;Label text="Aufgaben gesamt:" GridPane.columnIndex="0" GridPane.rowIndex="2" /&gt; 
                          &lt;Label fx:id="toDos" GridPane.columnIndex="1" GridPane.rowIndex="2" /&gt;
                      &lt;/GridPane&gt;
                  &lt;/TitledPane&gt;
                  &lt;TitledPane text="Aktuell" expanded="true"&gt;
                      &lt;GridPane fx:id="actualPane"&gt; 
                      &lt;/GridPane&gt; 
                  &lt;/TitledPane&gt;
              &lt;/VBox&gt;
          &lt;/Tab&gt;
      &lt;/TabPane&gt;
  &lt;/center&gt;
  </code></pre>
  
  <p>Everytime I want to set the Text of username I got this NULLPointerException:</p>
  
  <pre><code>Caused by: java.lang.NullPointerException
  at homenizer.controller.HomenizerController.setWelcomeTab(HomenizerController.java:44)
  at homenizer.controller.HomenizerController.startHomenizer(HomenizerController.java:76)
  at homenizer.controller.LoginController.onStartRequest(LoginController.java:107)
  ... 54 more
  </code></pre>
  
  <p>Exception in thread "JavaFX Application Thread" Deleting directory C:\Users\chris_000\Documents\NetBeansProjects\Homenizer\dist\run1609603179</p>
  
  <p>So, does anybody know the problem I got?I can't find a solution :(
  Thanks for every help</p>
  
  <p>-GhostfaceChilla-</p>