I use CheckBoxTableCell in my project for view data. But when I ckecked several data and scrolling to down table, unchecked data becomes checked.
This is my realisation:
public void loadXmlToTableView() {
ObservableList<Tweet> data = FXCollections.observableArrayList();
for (Tweet loop : IOoperations.getXml()) {
data.add(loop);
}
retweet.setItems(data);
colRetweetDate.setCellValueFactory(new PropertyValueFactory<Tweet, Date>("tweetDate"));
colText.setCellValueFactory(new PropertyValueFactory<Tweet, String>("text"));
colUserName.setCellValueFactory(new PropertyValueFactory<Tweet, String>("userName"));
colChek.setCellValueFactory(new PropertyValueFactory<Tweet, Boolean>("selected"));
colChek.setCellFactory(CheckBoxTableCell.forTableColumn(colChek));
colChek.setEditable(true);
retweet.setEditable(true);
colChek.setMaxWidth(50);
colChek.setMinWidth(50);
}
Aucun commentaire:
Enregistrer un commentaire