Bidirectional binding is very convenient for properties of the same type, but you are not restricted by that. You can bind bidirectionally properties of String and any other type by providing a corresponding converter.
There is a large list of predefined converters for the common types, for example, binding a number and a string:
Bindings.bindBidirectional(
textProperty, numberProperty, new NumberStringConverter());
This converter also supports Locale and patterns from the java.text.DecimalFormat class. See the following application as an example:
// chapter3/other/BidiConverters.java
public void start(Stage stage) {
Slider s1 = new Slider(0, 100, 40);
TextField tf1 = new TextField();
tf1.textProperty().bindBidirectional(s1.valueProperty(),
new NumberStringConverter());
TextField tf2...