title: JavaFx setText for Label
body: <p>i'm new at JavaFx and actually i'm trying to change/set a label text. In my eyes i did everything that is to do but it does not work. Hope that someone could help me. I'm searching now for hours but guess i'll never find my misstake. Furthermore i guess the misstake is to find at the controller but in some examples i watched, it looks similar to my code.. </p>
  
  <p>The FXML:
      </p>
  
  <pre><code>&lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.Label?&gt;
  &lt;?import javafx.scene.control.SplitPane?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  &lt;?import javafx.scene.text.Font?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import java.util.*?&gt;
  &lt;?import javafx.scene.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  
  &lt;SplitPane id="Split" dividerPositions="0.3" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="620.0" prefWidth="871.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="presentation.DataController"&gt;
    &lt;items&gt;
      &lt;AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"&gt;
           &lt;children&gt;
              &lt;Label id ="name" fx:id="name" layoutX="26.0" layoutY="21.0" prefHeight="576.0" prefWidth="205.0" textAlignment="CENTER"/&gt;
           &lt;/children&gt;&lt;/AnchorPane&gt;
      &lt;AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"&gt;
           &lt;children&gt;
              &lt;Label fx:id="daten" layoutX="19.0" layoutY="14.0" prefHeight="576.0" prefWidth="511.0"/&gt;
   &lt;!--           &lt;Slider layoutX="573.0" layoutY="11.0" orientation="VERTICAL" prefHeight="576.0" prefWidth="14.0" /&gt; !--&gt;
           &lt;/children&gt;&lt;/AnchorPane&gt;
    &lt;/items&gt;
  &lt;/SplitPane&gt;
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>package presentation;
  
  import java.net.URL;
  import java.util.ResourceBundle;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.Initializable;
  import javafx.scene.control.Label;
  
  public class DataController implements Initializable {
  
      @FXML
      private Label name;
      private Label daten;
  
      private void init() {
          name.setText("Hello World!");
          daten.setText("AnotherTest");
      }
  
  
      @Override
      public void initialize(URL url, ResourceBundle rb) {
          // TODO
      }    
  
  }
  </code></pre>
  
  <p>And the Application Class</p>
  
  <pre><code>package presentation;
  
  
  import application.*;
  import data.*;
  import javafx.application.Application;
  import static javafx.application.Application.launch;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.control.Label;
  import javafx.stage.Stage;
  
  
  public class Data extends Application {
  
      @Override
      public void start(Stage stage) throws Exception {
          Parent root = FXMLLoader.load(getClass().getResource("DataView.fxml")); 
          Scene scene = new Scene(root);
  
          stage.setTitle("Übung 0");
          stage.setScene(scene);
          stage.show();
      }
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          launch(args);
      }
  
  }
  </code></pre>