我应该如何使用 1 列的集合?我努力了:
private ObservableList<EmailU> emails= FXCollections.observableList(new ArrayList<EmailU>());
public ObservableList<EmailU> emailsProperty() {
return emails;
}
接着
col_email.setCellValueFactory(
new PropertyValueFactory<Client, ObservableList<EmailU>>("emails"));
col_email.setCellFactory(new MultilineTextFieldCellFactory());
但得到以下错误:
SEVERE: javafx.scene.control.Control loadSkinClass Failed to load skin 'StringProperty [bean: TableRow[id=null, styleClass=cell indexed-cell table-row-cell], name: skinClassName, value: com.sun.javafx.scene.control.skin.TableRowSkin]' for control TableRow[id=null, styleClass=cell indexed-cell table-row-cell]
java.lang.RuntimeException: java.lang.ClassCastException: com.sun.javafx.collections.ObservableListWrapper cannot be cast to javafx.beans.property.ReadOnlyProperty*
有任何想法吗?