tags:

views:

418

answers:

2

I have a JFrame but it displays a Java icon on the title bar (left corner). I want to change that icon to my custom icon. How should i do it ?

A: 

JFrame.setIconImage(Image image) pretty standard.

Gandalf
+3  A: 

Create a new ImageIcon object like this:

ImageIcon img = new ImageIcon(pathToFileOnDisk);

then set it to your Frame:

mYFrame.setIconImage(img);
BFree
what should be the size of the icon?.. im gonna create one now ..
lakshmanan
See here for interesting discussion about size: http://www.coderanch.com/t/343726/Swing-AWT-SWT-JFace/java/Frame-s-setIconImage-optimum-image
BFree