How to set image of my own choice say baby.jpg as an icon on the title bar of the jFrame..
Please also help with codes if required ,, i am newbie in java and NetBeans..
Other people will have the same problem, and will find this article, so please share yur solution with the rest of the DaniWeb community.
I have got the solution.
If you are using NetBeans IDE then it can be done in two steps.
step 1 .
In declaration write
Image img =(new ImageIcon(getClass().getResource("/images/sirte_ico.JPG"))).getImage();
here img is the object created , will be used in step 2 below .
"/images/sirte_ico.JPG" here images is the folder name under "src" folder and sirte_ico.JPG is picture name i had chosen to set as icon for frame at title bar.
In navigator window , right click on the "JFrame" you want to set icon for and then choose properties.
in "Other properties section" you will find an option "iconImage" and a small button , click on the small button , you can an option "Set Form's iconImage property using : " choose "custom code" from the scroll down menu .
Now you will see "Form.setIconImage( [EMPTY BOX] );
img in the box as the object made in step 1 .
Press OK ,
close the properties window.