I'm trying to make a simple loading window in JavaFX and I'm using an information alert for this. Here's my code:
public Alert alert = new Alert(Alert.AlertType.INFORMATION);
public void drawData(javafx.event.ActionEvent actionEvent) {
alert.setHeaderText(null);
alert.setTitle("Loading...");
alert.show();
for (int i = 0; i < * something * ; i++) {
/* some code here */
System.out.println(i);
alert.setContentText(Integer.toString(i));
}
alert.close();
}
}
But this doesn't seem to work. All I'm getting is empty alert window:
Is there really a way I can fix that? Also, how do I ignore the alert's OK button?