I am doing a GET request by JAVA, and this take some time, I've shown a loading window, but it crashes until the GET request finishes.
@FXML
private void recogerDatos() throws IOException, InterruptedException {
System.out.println("Haciendo la peticion GET a " + ip + ":" + puerto);
respuestaStruct = getRequest();
for (int i = 0; respuestaStruct.isHaFallado() == false && i < 6; i++) {
System.out.println("Intennto:"+i);
Thread.sleep(3000);
respuestaStruct = getRequest();
}if (respuestaStruct.isHaFallado() == true) {
System.out.println("GET realizado correctamente.");
writeDevice.setDisable(false);
} else {
System.out.println("Error de la peticion GET");
mensajeError = true;
}
MainApp.loading.close();
}