Associate IntegerProperty with DoubleProperty

I would like to create a bi-directional binding between IntegerProperty and DoubleProperty. The converter function will be easy to write to create a mapping between two values, but I cannot find a way to do this. I am looking for something similar in functionality for StringConverter, but with common parameters.

Is there a way to do this in JavaFX?

0
source share
1 answer

Since both of them are implementations of Property<Number> , it should just work:

  DoubleProperty d = new SimpleDoubleProperty(); IntegerProperty i = new SimpleIntegerProperty(); d.bindBidirectional(i); 
+3
source

Source: https://habr.com/ru/post/1240159/


All Articles