Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can't set more than one controller within an FXML file using <code>(fx:controller="")</code>, instead consider injecting the controller manually, basically there are two ways : </p> <p>Using <a href="http://docs.oracle.com/javafx/2/api/javafx/fxml/FXMLLoader.html#setController%28java.lang.Object%29" rel="nofollow">setController</a> method without mention the controller inside the FXML file :</p> <pre><code>FXMLLoader loader = new FXMLLoader(); URL location = getClass().getClassLoader().getResource("fxml/ClientArea.fxml"); loader.setLocation(location); loader.setController(new ClientArea()); // loader.setController(new Undecorator()); loader.load(); </code></pre> <hr> <p>More appropriately, use <a href="http://docs.oracle.com/javafx/2/api/javafx/fxml/FXMLLoader.html#setControllerFactory%28javafx.util.Callback%29" rel="nofollow">setControllerFactory</a> method :</p> <p>first, make sure that both of the controllers <code>ClientArea</code> and <code>Undecorator</code> implement an interface (<code>Icontroller</code>, containing the event Handler methods) mentioned in the <code>FXML</code> file <code>(fx:controller="IController")</code>, then choose the controller when loading your View from the <code>FXML</code> file: </p> <pre><code>FXMLLoader loader= new FXMLLoader(); URL location = getClass().getClassLoader().getResource("fxml/ClientArea.fxml"); loader.setLocation(location); loader.setControllerFactory(new Callback&lt;Class&lt;?&gt;, Object&gt;() { public Object call(Class&lt;?&gt; p) { return new ClientArea(); // return new Undeorator(); } }); loader.load(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload