1
Code I tried to make, but it doesn’t work:
Javafx FXML Application:
salvar.setOnAction((ActionEvent e) -> {
Stage window = (Stage) cont.getScene().getWindow();
try {
String corpo = cont.getText();
FileWriter gravarFile = new FileWriter(corpo, false);
PrintWriter gravar = new PrintWriter(gravarFile + ".txt");
gravar.write(corpo);
gravar.close();
}catch(IOException ex) {
System.out.println("Conteudo não poderá ser gravado!");
ex.printStackTrace();
}
});
What’s wrong with this code above?
Hello, better define the error that is happening, if you can put the error/Exception that is being released.
– Danilo Costa