Tableview with Checkbox - Javafx

Asked

Viewed 206 times

1

I’m filling in the TableView with a ArrayList<HashMap<String, Object>> and I’m not using a model table but getting the data from ArrayList.

By marking the CheckBox, need to get the data from a specific column. Someone has an example this way?

I’ve done a lot of research and all the examples refer to a class that contains all the data.

Follows excerpt from the code of TableView:

ObservableList obList = FXCollections.observableArrayList(list);
colCod.setCellValueFactory(new MapValueFactory("CAMPO0"));
colContrato.setCellValueFactory(new MapValueFactory("CAMPO7"));
colCpf.setCellValueFactory(new MapValueFactory("CAMPO1"));
colCliente.setCellValueFactory(new MapValueFactory("CAMPO2"));
colProd.setCellValueFactory(new MapValueFactory("CAMPO9"));
colValor.setCellValueFactory(new MapValueFactory("CAMPO14"));
colStatus.setCellValueFactory(new MapValueFactory("CAMPO15"));
colCk.setCellFactory(CheckBoxTableCell.forTableColumn(colCk)); //definição do checkbox
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.