title: JavaFX Error: Controller value already specified
body: <p>I'm trying to open a new form window. But I want to assign some values in the constructor.</p>
  
  <p>The codes I tried:</p>
  
  <pre><code>fxmlLoader.setRoot(null);
  </code></pre>
  
  <p>fx:root (DbForm.fxml) </p>
  
  <p>Error: </p>
  
  <p>Controller value already specified.
  file:/C:/Users/Admin/Documents/NetBeansProjects/SeleniumWebTest/dist/run685287776/SeleniumWebTest.jar!/seleniumwebtest/DbForm.fxml:14</p>
  
  <pre><code>try {
  
       DbFormController dbYapCont = new DbFormController("s", "s", "s", "s");
       FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("DbForm.fxml"));
  
       fxmlLoader.setController(dbYapCont);
       Pane root = (Pane) fxmlLoader.load();
       Stage stage = new Stage();
       stage.setScene(new Scene(root));
       stage.show();
       } catch (Exception e) {
                  System.out.println(e.getMessage());
              }
  </code></pre>