javafx中tableView双击行事件
作者:互联网
tableView.setRowFactory(new Callback<TableView<SerialData>, TableRow<SerialData>>() { @Override public TableRow<SerialData> call(TableView<SerialData> param) { TableRow<SerialData> row = new TableRow<SerialData>(); row.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { if (event.getClickCount() == 2 && (! row.isEmpty()) ) { System.out.println(row.getIndex()); SerialData serialData = row.getItem(); System.out.println(serialData.getName()); } } }); return row; } });
标签:tableView,TableRow,javafx,System,event,Override,new,双击,row 来源: https://www.cnblogs.com/qinggua/p/13054451.html