Getting selected item from a JavaFX TableView

前端 未结 7 1578
轻奢々
轻奢々 2020-12-15 16:01

How do I get the selected item from a TableView in JavaFX?

I am currently using

ObservableList selectedItems = taview.getSelectionModel(         


        
相关标签:
7条回答
  • 2020-12-15 16:49

    if you have a Bean class named Employee.

    Employee employee= tblView.getSelectionModel().getSelectedItem();
    txtEmployeeName.setText(employee.getName());
    
    0 讨论(0)
提交回复
热议问题