I want to create a simple ListView. I have figured out I can use the method setCellFactory() but I don\'t understand how to use them correctly. So far I have:
listView.setCellFactory(CheckBoxListCell.forListView(new Callback>() {
@Override
public ObservableValue call(String item) {
BooleanProperty observable = new SimpleBooleanProperty();
observable.addListener((obs, wasSelected, isNowSelected) ->
System.out.println("Check box for "+item+" changed from "+wasSelected+" to "+isNowSelected)
);
return observable ;
}
}));
Thank you! This helps me to solve my problem.