How to Get First Column Value on click in JavaFX TableView like JTable in swing?

前端 未结 3 1157
我寻月下人不归
我寻月下人不归 2020-12-22 04:13

I want to get First column value as we can achieve in Jtable using swing. below is my code and image for jtable.

String Table_Clicked = jTable1.getModel().ge         


        
3条回答
  •  无人及你
    2020-12-22 04:29

    You have to take a look at the underlying ObservableList. The code that works for me was:

    tableView.getItems().get(tableView.getSelectionModel().getSelectedIndex())
    

    In my test that returns a Person object (POJO i wrote) which has to contain a get() method.

提交回复
热议问题