Is it possible to change the application icon using JavaFX, or does it have to be done using Swing?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
It is good habit to make images folder in your src folder and get images from it.
What do you think about creating new package i.e image.icons in your src directory and moving there you .png images? Than you just need to write:
This solution works for me perfectly, but still I'm not sure if it's correct (beginner here).
I tried this and it works:
Image image3 = new Image("Path");
stage.getIcons().add(image3);
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
I used this in my application
Here window is the stage.