Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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);
- }
- select t1.`nome`, `gols_time1`, t2.`nome`, `gols_time2` from partida
- inner join `time` t1 on (`time1` = t1.`idtime`)
- inner join `time` t2 on (`time2` = t2.`idtime`)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement