title: Binding SimpleObjectProperty
body: <p>I want to bind a simple object property. But I get this error </p>
  
  <pre><code>java.lang.ClassCastException: java.lang.String cannot be cast to java.time.LocalDate.
  </code></pre>
  
  <p>Please this is the code below.</p>
  
  <p>EmployeeShowController.java</p>
  
  <pre><code>public class EmployeeShowController implements Initializable{
      @FXML private Label db;
  
      public void update()throws IOException{
      FXMLLoader loader =new FXMLLoader(getClass().getResource("EmployeeUpdate.fxml"));
      Parent newParent =loader.load();
      EmployeeUpdateController subController=loader.getController();
      subController.textToDisplay.set(db.getText());
  
      Stage stage =new Stage();
      Scene scene = new Scene(newParent);
      stage.setScene(scene);
      stage.show();
  
      @Override
      public void initialize(){
      }
  }
  </code></pre>
  
  <p>EmployeeUpdateController.java</p>
  
  <pre><code>public class EmployeeUpdateController implements Initializable{
      @FXML private DatePicker dateOfBirth;
       public SimpleObjectProperty textToDisplay= new SimpleObjectProperty&lt;&gt;();
      @Override
      Public void initialize(){
          dateOfBirth.valueProperty().bind(textToDisplay);
      }
  
  }
  </code></pre>