Select row in Javafx Tableview

前端 未结 2 1063
情歌与酒
情歌与酒 2021-01-20 03:01

\"enter

According to my above Table view once I click on any Action icon it will navig

相关标签:
2条回答
  • 2021-01-20 03:39

    Just remember the current selection (as a field) in your table view wrapper instance, and the restore it on re-focus.

    0 讨论(0)
  • 2021-01-20 03:45

    So sorry actually I have duplicated the question

    Correct answer was there:

    Platform.runLater(new Runnable()
    {
        @Override
        public void run()
        {
            table.requestFocus();
            table.getSelectionModel().select(0);
            table.getFocusModel().focus(0);
        }
    });
    
    0 讨论(0)
提交回复
热议问题