JavaFX Application Icon

后端 未结 17 1664
滥情空心
滥情空心 2020-11-28 02:25

Is it possible to change the application icon using JavaFX, or does it have to be done using Swing?

17条回答
  •  情深已故
    2020-11-28 02:30

    stage.getIcons().add(new Image(.class.getResourceAsStream("/icon.png" )));
    

    You can add more than one icon with different sizes using this method.The images should be different sizes of the same image and the best size will be chosen. eg. 16x16, 32,32

提交回复
热议问题