1listViewOfWords.setCellFactory(param -> new ListCell<Word>() {
2 @Override
3 protected void updateItem(Word item, boolean empty) {
4 super.updateItem(item, empty);
5
6 if (empty || item == null || item.getWord() == null) {
7 setText(null);
8 } else {
9 setText(item.getWord());
10 }
11 }
12});
13