当我在表格栏上设置值时,它总是错误地说"无法读取不可读的属性名称" name是我正在访问的字段,位于产品类
伪代码:
`
public class OrderItem() {
Integer Id;
String comment
Product product;
*getter and setter method*
}
public class Product() {
String name
*getter and setter method*
}
public class Controller(){
@FXML
private TableView<OrderItem> tblItems;
@FXML
private TableColumn<Product, String> colProduct;
public void initialize(URL url, ResourceBundle rb) {
colProduct.setCellValueFactory(new PropertyValueFactory<Product, String>("name"));
//rest of code where i pull data
}
}
`