Adam Bien's Weblog
Java FX 2 Data Binding Explained …With A JUnit Test
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
public class StringDataBindingTest {
@Test
public void bindUnidirectionally(){
String expected = "DukeFX";
StringProperty from = new SimpleStringProperty();
StringProperty to = new SimpleStringProperty();
to.bind(from);
from.set(expected);
String actual = to.get();
assertThat(actual,is(expected));
}
}
Any questions? :-)
Posted at 09:16AM Dec 23, 2011 by Adam Bien in Real World Java EE Patterns - Rethinking Best Practices | Comments[1] | Views/Hits: 2065
*NEW* Workshop: "Real World Java EE 6/7 Bootstrap" and book: Real World Java EE Night Hacks--Dissecting the Business Tier Tweet Follow @AdamBien



Ah, now i've got it :)
Posted by Mike on December 23, 2011 at 09:41 AM CET #