How do you set the icon of a Dialog control Java FX/Java 8

后端 未结 4 2143
臣服心动
臣服心动 2021-02-07 05:15

I might be missing something very obvious, but I can\'t find out how to set the Icon for a Dialog component (ProgressDialog to be more precise). I know how to do that for a Stag

4条回答
  •  面向向阳花
    2021-02-07 05:39

    Just Do like this:

    Alert(AlertType.ERROR, "Erreur de connexion! Verifiez vos Identifiants",FINISH); //Cancel..
    setTitle("XNotes FX Erreur");
    stage = (Stage) alert.getDialogPane().getScene().getWindow();
    stage.getIcons().add(new Image("indiza/XnotesErrorIdz.png")); // To add an icon
    showAndWait();
    

    Here is the result

    **My friends, is it computer science that we do? : No, we do crafts **

提交回复
热议问题