📅  最后修改于: 2022-03-11 14:52:32.054000             🧑  作者: Mango
listViewOfWords.setCellFactory(param -> new ListCell() {
@Override
protected void updateItem(Word item, boolean empty) {
super.updateItem(item, empty);
if (empty || item == null || item.getWord() == null) {
setText(null);
} else {
setText(item.getWord());
}
}
});