Semester 3 😎
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package javafx_calebfontenot;
|
||||
|
||||
import javafx.beans.property.DoubleProperty;
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class BidirectionalBindingDemo {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
DoubleProperty d1 = new SimpleDoubleProperty(1);
|
||||
DoubleProperty d2 = new SimpleDoubleProperty(2);
|
||||
|
||||
System.out.println("d1 is " + d1.getValue()
|
||||
+ " and d2 is " + d2.getValue());
|
||||
d1.bindBidirectional(d2);
|
||||
System.out.println("d1 is " + d1.getValue()
|
||||
+ " and d2 is " + d2.getValue());
|
||||
d1.setValue(50.1);
|
||||
System.out.println("d1 is " + d1.getValue()
|
||||
+ " and d2 is " + d2.getValue());
|
||||
d2.setValue(70.2);
|
||||
System.out.println("d1 is " + d1.getValue()
|
||||
+ " and d2 is " + d2.getValue());
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user