how to change the Control icon in window

hi to all

this is my first post to thiss forum and im using java swing for desktop application im facing a little problem is that how to change control icon on window created by java swing example is here

http://i108.photobucket.com/albums/n15/zerocool_007/window.jpg

how to change the red circuled icon any simple code tips will help mee

zero

[377 byte] By [zerocooola] at [2007-10-3 7:21:00]
# 1

myJFrame.setIconImage(img);

where img is an Image object.

The easiest way to create an Image is the following:

Toolkit toolkit = Toolkit.getDefaultToolkit();

Image img = toolkit.getImage("myImage.jpg");

remember you need to import java.awt.Toolkit at the top of your class.

Good Luck,

Eugene

eugeneiusa at 2007-7-15 2:18:37 > top of Java-index,Desktop,Developing for the Desktop...
# 2
Very Thank its really work .i was thinking that we cant change that icon but is so simple to change it coz some body told me u have to alot of coding to change it but is just 3 line of code....again really thankful and this forum is also helpful for me...zero
zerocooola at 2007-7-15 2:18:37 > top of Java-index,Desktop,Developing for the Desktop...