Changing system menu icon of JFrame

Hi,

I would like the icon for the system menu of a JFrame changed to my own custom icon. What I need to know is what kind of image file I need for the icon. Can a .GIF file do? And what resolution should it be?

Also, suppose my java application runs on a Windows system, and I want to create a custom desktop icon to launch my application. How do I make that icon? From what I can tell from a normal .EXE program, the icon is stored inside the .EXE file.
LVL 9
yongsingAsked:
Who is Participating?
 
heyhey_Connect With a Mentor Commented:
ImageIcon icon = new ImageIcon("system.gif");
frame.setIconImage(icon.getImage());
0
 
yongsingAuthor Commented:
But what pixel resolution should the system.gif file be? Should it be 16 x 16 or 32 x 32?
0
 
heyhey_Commented:
I suppose that the image will be automatically resized ...


public synchronized void setIconImage(Image image)

Sets the image to display when this frame is iconized. Not all platforms support the concept of iconizing a window.

Parameters:
image - the icon image to be displayed
0
 
Sasha_MapaCommented:
You can use frame.getIconImage() to get the default one and check its size, but there are probably better solutions :-)
0
 
heyhey_Commented:
:)

well, actually I don't remember the size ... :) but I suppose that every Image object will be automatically resized.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.