JavaFx 2.1, 2.2 TableView update issue

后端 未结 7 1013
青春惊慌失措
青春惊慌失措 2021-02-06 17:41

My application uses JPA read data into TableView then modify and display them. The table refreshed modified record under JavaFx 2.0.3. Under JavaFx 2.1, 2.2, the table wouldn\'t

7条回答
  •  终归单人心
    2021-02-06 18:25

    looking into the TableView.java code, there's private refresh() which just executes

    getProperties().put(TableViewSkinBase.REFRESH, Boolean.TRUE); 
    

    At last, the code below worked for me(Java8). (be careful, the constant's name is not REFRESH but RECREATE)

    tableView.getProperties().put(TableViewSkinBase.RECREATE, Boolean.TRUE);
    

    (reading javafx's code, this will force cell re-creation)

提交回复
热议问题