Source of BindingDemo.java


  1: 
  2: import javafx.beans.property.DoubleProperty;
  3: import javafx.beans.property.SimpleDoubleProperty;
  4: 
  5: public class BindingDemo {
  6:   public static void main(String[] args) {
  7:     DoubleProperty d1 = new SimpleDoubleProperty(1);
  8:     DoubleProperty d2 = new SimpleDoubleProperty(2);
  9:     d1.bind(d2);
 10:     System.out.println("d1 is " + d1.getValue()
 11:       + " and d2 is " + d2.getValue());
 12:     d2.setValue(70.2);
 13:     System.out.println("d1 is " + d1.getValue()
 14:       + " and d2 is " + d2.getValue());
 15:   }
 16: }