I am using:
- Java:..... 1.8.0_20
- JavaFX:... 8.0.20-b26
I have this class:
public class Person {
private SimpleStringProperty name;
public SimpleStringProperty nameProperty(){
if(this.name==null){
this.name=new SimpleStringProperty();
}
return this.name;
}
public final void setName(String value){
nameProperty().set(value);
}
public String getName(){
return nameProperty().get();
}
public Person(String value){
setName(value);
}
public String toString(){
return this.getName();
}
}
I have this:
lista = FXCollections.<Person>observableArrayList();
lista.addAll(new Person("uno"),new Person("due"),new Person("tre"));
myListView.setItems(lista);
the problem is if I add /remove an item all is fine, the listView refreshes correctly:
Person p = new Person(tfld_textAdd.getText());
lista.add(0, p);
but if I change a value on an item into the observable list it doesn't:
lista.get(0).setName("new value");
I also have a table linked in the same way and the table workd correctly after I updated my Java version...
Thanks in advance.