title: Load new Tab dynamically with own FXMLs
body: <p>I want to write an application, that has got a few options. The user can choose in a menu one option and a tab should be created, which loads its view from another fxml-file(, which has also another view-controller). Currently my code looks like:</p>
  
  <pre><code>Tab t = new Tab("My New Tab");
  try {
      t.setClosable(true);
      t.setId("test");
      t.setContent(FXMLLoader.
        load(getClass().
          getResource("/package/NewTabView.fxml")));
  } catch (Exception e) {
  
  }
  
  tabPane.getTabs().add(t);
  selectionModel.selectLast();
  </code></pre>
  
  <p>Hope you can help me, because I get the following Exception:</p>
  
  <pre><code>Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  </code></pre>