title: JavaFX 8, controllers inheritance
body: <p>I have some sort of problem during migration from javafx 2.2 to javafx 8; 
  Javafx 8 doesn't support static @FXML elements.</p>
  
  <p>I have the following situation (code is simplified):</p>
  
  <p>Parent controller:</p>
  
  <pre><code>public abstract class ParentController implements Initializable {
  
  @FXML
  protected Label parentLabel;
  
  @Override
  public void initialize(URL location, ResourceBundle resources) {
      // do smth
  }
  
  }
  </code></pre>
  
  <p>Child Controller (there is not only one child):</p>
  
  <pre><code>public class ChildController extends ParentController {
  
  @Override
  public void initialize(URL location, ResourceBundle resources) {
      super.initialize(location, resources); 
  
      parentLabel.setText("text");
  }
  
  }
  </code></pre>
  
  <p>In previous version of this code parentLabel was static and it worked fine.
  But now I have NullPointerException while trying to setText on label.</p>
  
  <p>I'm looking for the simplest solution in this situation. </p>
  
  <p><strong>UPD 1.</strong></p>
  
  <p>child fxml:</p>
  
  <pre><code>&lt;AnchorPane id="" fx:id="apDentalClinics" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="590.0" prefWidth="1200.0" style="" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="com.package.ChildController"&gt;
  &lt;children&gt;
      //Something here, except our lable
  &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>