How can I set program icon to alert without using alert.initOwner()?
Why without initOwner? It\'s because some alert must be shown before whole win
This is how it is done:
// Get the Stage.
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
// Add a custom icon.
stage.getIcons().stage.getIcons().add(new Image("images/logo_full3.png"));
There might be problem with the image reference above. But you can try to configure as long as it works. This is how I do (I use maven). Yours might be different if you are not using maven.
Full tutorial here: Alert javafx tutorial