I want to commit changes on ListCell
without enter key.
I have the following code :
objetListview1.setEditable(true);
objetListview1.setItems(FXCollections.observableArrayList(observableSet2));
objetListview1.setEditable(true);
objetListview1.setCellFactory(lv -> {
TextFieldListCell<Typ> cell = new TextFieldListCell<Typ>();
StringConverter<Typ> converter = new StringConverter<Typ>() {
@Override
public String toString(Typ obj) {
return obj.getTyp();
}
@Override
public Typ fromString(String string) {
Typ obj = cell.getItem();
if (obj == null) {
Typ newObj = new Typ("");
newObj.setTyp(string);
return newObj;
} else {
obj.setTyp(string);
return obj;
}
}
};
cell.setConverter(converter);
return cell;
});
Actually with this code, I can commit change with enter key.
Any help please?