title: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException when setting values of new controler
body: <p>I have following setup:</p>
  
  <p>2 FXML-Doxuments WelcomeScreen.fxml and Timesheet.fxml with it's both controllers WelcomeScreenController.java and TimesheetController.java.</p>
  
  <p>On WelcomeScreenController I have an button action handler </p>
  
  <pre><code>createTimesheet(ActionEvent event){
      // Some working code
  
      final Calendar calendarStart = Calendar.getInstance();
      calendarStart.setTime(sdf.parse(tfStartDate.getText()));
  
      final Calendar calendarEnd = Calendar.getInstance();
      calendarEnd.setTime(sdf.parse(tfEndDate.getText()));
  
      final FXMLLoader loader = new FXMLLoader(getClass().getResource("Timesheet.fxml"));
      final TimesheetControler timesheetControler = (TimesheetControler)loader.getController();
  
      timesheetControler.setStartDate(calendarStart);
      timesheetControler.setEndDate(calendarEnd);
  
      timesheetControler.setHeadlineText("Timesheet (" + tfStartDate.getText() + " - " + tfEndDate.getText() + ")");
  
      final Node node=(Node) event.getSource();
      final Stage stage=(Stage) node.getScene().getWindow();
      final Parent root = (Parent) loader.load();
  
      stage.setScene(new Scene(root));
      stage.show();
  }
  </code></pre>
  
  <p>TimesheetController looks like this:</p>
  
  <pre><code>package de.liebich.work.report.emb.ui;
  
  public class TimesheetControler implements Initializable {
  
  @FXML
  private Label lHeadline;
  @FXML
  private GridPane gTimesheetCheck;
  
  private Calendar startDate;
  private Calendar endDate;
  private String user;
  private String password;
  private String baseURL;
  
  private List&lt;List&lt;Label&gt;&gt; entries;
  @Override
  public void initialize(URL arg0, ResourceBundle arg1) {
  
  }
  
  public void setStartDate(Calendar startDate) {
      this.startDate = startDate;
  }
  
  public void setEndDate(Calendar endDate) {
      this.endDate = endDate;
  }
  
  public void setUser(String user) {
      this.user = user;
  }
  
  public void setPassword(String pw) {
      this.password = pw;
  }
  
  public void setBaseURL(String baseURL) {
      this.baseURL = baseURL;
  }
  public void setHeadlineText(final String text){
      lHeadline.setText(text);
  }
  }
  </code></pre>
  
  <p>When I call createTimesheet I get following error:</p>
  
  <pre><code>java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1449)
  at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
  at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
  at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
  at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
  at javafx.event.Event.fireEvent(Event.java:171)
  at javafx.scene.Node.fireEvent(Node.java:6867)
  at javafx.scene.control.Button.fire(Button.java:179)
  at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
  at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
  at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
  at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
  at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
  at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
  at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
  at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
  at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
  at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
  at javafx.event.Event.fireEvent(Event.java:171)
  at javafx.scene.Scene$MouseHandler.process(Scene.java:3311)
  at javafx.scene.Scene$MouseHandler.process(Scene.java:3151)
  at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106)
  at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
  at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248)
  at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
  at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
  at java.security.AccessController.doPrivileged(Native Method)
  at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
  at com.sun.glass.ui.View.handleMouseEvent(View.java:530)
  at com.sun.glass.ui.View.notifyMouse(View.java:924)
  at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
  at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
  at java.lang.Thread.run(Thread.java:744)
  Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
  at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
  at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1444)
  ... 44 more
  Caused by: java.lang.NullPointerException
  at de.liebich.work.report.emb.ui.WelcomeScreenControler.createTimesheet(WelcomeScreenControler.java:133)
  ... 54 more
  </code></pre>
  
  <p>What do I have to change to make my code working?</p>