Galera, sou muito iniciante na área. To precisando transformar esse foreach em um for simples, mas sempre acabo cagando no código. Alguém pode me ajudar?
@FXML
private void salvar() {
criarTempExcel(rows);
rows.forEach(row -> { <<<<<<<<<<<<<<<<<<TRANSFORMAR EM FOR SIMPLES
try {
if (row.getCell(0).getCellType().toString() != "BLANK") {
List<Cell> cells = (List<Cell>) toList(row.cellIterator());
try {
ExcelLoadDao.getInstance().popularTemporaria(cells);
} catch (SQLException e) {
System.out.println("exception botão salvar");
e.printStackTrace();
//JOptionPane.showMessageDialog(null, "Erro ao salvar carga: " + e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e) {
e.printStackTrace();
}
});
try {
ExcelLoadDao.getInstance().persistirTemp(
listaTabelas.get(cmbTabelas.getSelectionModel().getSelectedIndex()).getComplemento());
} catch (SQLException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Erro ao salvar carga: " + e.getMessage());
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Erro ao salvar carga: " + e.getMessage());
}
listViewExcel.getItems().clear();
btnSalvar.setDisable(true);
}