I'm trying to change the default java icon that appears in taskbar everytime I run my .jar program. I managed to change it with frame.setIconImage(img); but this makes icon way too small, I want it to be as big as other programs icons and have a high quality. Any way I can do that? Thanks.
相关问题
- 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
As you only supplied a single icon, Windows will then scale that icon to whatever size it needs displaying it in the taskbar (could be 16x16, 32x32 or other sizes, depending on the desktop them and size of the taskbar.
If you want to have a "good looking" icon in the task bar you will need to provide a 32x32 pixel version of your icon.
Once you have that you can call
setIconImages(List)
instead ofsetIconImage()
to define the icons that the operating system can use:Where
getImage()
is some method returning the proper image icon. Essentially that would be the same steps you already used to define the current icon.You can also supply a 64x64 and 24x24 icon using this method (just add more icons to the list).
Try looking at this example. It looks like you need to use
frame.setIconImage(Toolkit.getDefaultToolkit().getImage("your_image.gif"));
line