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
alert.initOwner()
initOwner
The correct implementation is following comments above:
// Get the Stage. Stage stage = (Stage) alert.getDialogPane().getScene().getWindow(); // Add a custom icon. stage.getIcons().add(new Image(getClass().getResourceAsStream("images/logo_full3.png")));