JavaFX TableView scrollTo() causing wrong row to start editing

后端 未结 1 800
一向
一向 2021-01-22 23:31

I have an editable TableView with a button that adds a new row then calls table.edit() on the first column in that row. When a user wants to add a row that will be out of the vi

相关标签:
1条回答
  • 2021-01-23 00:23

    Completely random hack that seems to work, despite me having no explanation for it:

        table.scrollTo(p); 
        table.layout();
        table.edit(data.indexOf(p), firstNameCol);
    

    You don't need the Platform.runLater(...) with this. I would file a bug for this, though, as the random hack should not be necessary...

    This was inspired by Uluk Biy's answer to this question

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