ListView CellFactory - How to remove cells correctly?
问题 I have a ListView that I am working to add a ContextMenu to. I have the ContextMenu working find but have another issue. My setCellFactory code, used to setup the context menus: lvAppetites.setCellFactory(lv -> { ListCell<Appetite> cell = new ListCell<>(); ContextMenu contextMenu = new ContextMenu(); MenuItem editAppetiteMenu = new MenuItem(); editAppetiteMenu.textProperty().bind(Bindings.format("Edit ...")); editAppetiteMenu.setOnAction(event -> { // Code to load the editor window