Javafx exception when clicking TreeTableCell after repopulating TreeTableView

前端 未结 1 1522
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 06:59

I am currently getting an error that I do not understand. The exception that is thrown points to nothing in my code, yet it is only thrown after I repopulate a TreeTableView by

1条回答
  •  情话喂你
    2021-01-21 07:42

        private void populate() {
        root.getChildren().clear()
        for (int i = 1; i <= 10; i++) {
            String string = "String " + i;
            TreeItem treeItem = new TreeItem(string);
            root.getChildren().add(treeItem);
    
            // --------------Clear the selection -------------
            table.getSelectionModel().clearSelection();
            // -----------------------------------------------
    
        }
    }
    

    0 讨论(0)
提交回复
热议问题