How do I write a new ListChangeListener() with lambda in java8?
listItems.addListener(new ListChangeListener<Item>() {
@Override
public void onChanged(
javafx.collections.ListChangeListener.Change<? extends Item> c) {
// TODO Auto-generated method stub
}
});
This is what I tried:
listItems.addListener(c->{});
But eclipse states:
The method addListener(ListChangeListener) is ambiguous for the type ObservableList.
The List is declared as:
ObservableList<Item> listItems = FXCollections.observableArrayList();
searchResultListItems.addListener((ListChangeListener.Change<? extends Contact> c) ->{});
did the trick thx for the hint – Loaning