请指定表格属性关联字段
//tableview声明
@FXML
TableView<StudentView> tableView;
//tableview列
@FXML
TableColumn<StudentView,String> column1;
//添加数据源
ObservableList<StudentView> studentViews = FXCollections.observableArrayList();
for (Student temps : s){
studentViews.add(studentService.convertFromStu(temps));
}
//指定列对应数据项
column6.setCellValueFactory(new PropertyValueFactory<>("grade"));
tableView.setItems(studentViews);
答疑请加Q:457330097