title: Bidirectional bindings of different properties
body: <p>I just tried to bind a Integer and a String property. After some googling this should be possible with one of the two provided methods:</p>
  
  <ol>
  <li><p>public static  void bindBidirectional(Property stringProperty,<br>
  Property otherProperty, StringConverter converter)</p></li>
  <li><p>public static void bindBidirectional(Property stringProperty,<br>
  Property otherProperty, java.text.Format format)</p></li>
  </ol>
  
  <p>Unluckily this does not seem to work for me. What am I doing wrong?</p>
  
  <pre><code>import java.text.Format;
  
  import javafx.beans.binding.Bindings;
  import javafx.beans.property.SimpleIntegerProperty;
  import javafx.beans.property.SimpleStringProperty;
  import javafx.util.converter.IntegerStringConverter;
  
  public class BiderectionalBinding {
  
      public static void main(String[] args) {
          SimpleIntegerProperty intProp = new SimpleIntegerProperty();
          SimpleStringProperty textProp = new SimpleStringProperty();
  
          Bindings.bindBidirectional(textProp, intProp, new IntegerStringConverter());
  
          intProp.set(2);
          System.out.println(textProp);
  
          textProp.set("8");
          System.out.println(intProp);    
      }
  }
  </code></pre>