What I\'m trying to do works fine if I follow the JavaFX property definition described here. Now, instead, I want to define properties from Java Beans objects using Java Bea
I think the issue here is that Person is indeed a POJO, but not a JavaBean: It is missing the hooks for PropertyChangeListeners. Java will not magically know when Person#name changes. Instead, the JavaFX adapter will look for a way to add a PropertyChangeListener and listen to events for a property called 'name'. If you add a PropertyChangeSupport instance to your Person class it will work as expected:
public class Person {
private String name;
private PropertyChangeSupport _changeSupport;
public Person() {
_changeSupport = new PropertyChangeSupport(this);
}
public String getName() {
return name;
}
public void setName( String name ) {
final String prev = this.name;
this.name = name;
_changeSupport.firePropertyChange("name", prev, name);
}
public void addPropertyChangeListener(final PropertyChangeListener listener) {
_changeSupport.addPropertyChangeListener(listener);
}
}