0
Next, I’m using hsqldb to do a college job, and I need to change the content of a tableview view view
In this case, in the columns Team name, you would need instead of code, the team name
The seat is mounted like this:
and the controller is like this:
@FXML private Button btnSalvar;
@FXML private TableView<Partida> tabela;
@FXML private TableColumn<Partida, String> clmTime1;
@FXML private TableColumn<Partida, Integer> clmPlacar1;
@FXML private TableColumn<String, String> clmX;
@FXML private TableColumn<Partida, Integer> clmPlacar2;
@FXML private TableColumn<Partida, String> clmTime2;
public void initialize(URL location, ResourceBundle resources) {
clmTime1.setCellValueFactory(new PropertyValueFactory<>("cod_time1"));
clmPlacar1.setCellValueFactory(new PropertyValueFactory<>("gol_time1"));
clmX.setCellValueFactory(new PropertyValueFactory<>(""));
clmPlacar2.setCellValueFactory(new PropertyValueFactory<>("gol_time2"));
clmTime2.setCellValueFactory(new PropertyValueFactory<>("cod_time2"));
refreshTable();
}
@FXML
private void refreshTable() {
ArrayList<Partida> listaPartida = new partidaDAO().listarPartidas();
ObservableList<Partida> observableList = FXCollections.observableArrayList(listaPartida);
tabela.setItems(observableList);
}
how could this change take place?
Hello, enter the code in the question and not a print.
– renanvm
Oops, I changed it here
– Gabriel Henrique