Showing results for 
Search instead for 
Do you mean 
Reply

Change custom icon of a java file

How can I change the icon of a java file in eclipse?

2 REPLIES

Re: Change custom icon of a java file

 

Use JFrame.SetIconImage(new ImageIcon(".\\image.jpg")).getImage());

 

Keep the image file in the package in workspace, if you are running from the eclipse.

 

If you export the file from Eclipse as Excecutable Jar file then keep the image file in the same folder where you saved the jar file.

To use ImageIcon include this statment import javax.swing.ImageIcon;

 

This is one way......

Re: Change custom icon of a java file

i don t want to use jframe...

 

consider a case when there is error in java program in eclipse, the java file icon gets changed to red cross(x) mark. in the same way, whenever my program executes the icon should be changed. Is there any way to do that?