To Change Icon image in frame

hoe to chage icon image of frame i.e the icon of java which comes on the top left of the frame.
harish_tyagiAsked:
Who is Participating?
 
expertmbConnect With a Mentor Commented:
hi,
 try this

 ImageIcon Image;  
 Image = new ImageIcon("\\title.gif");
 frame.setIconImage(Image.getImage());


mb...
0
 
expertmbCommented:
hi,

here is the sample code .

import java.awt.*;
import javax.swing.*;

public class FrameIcon{

public static void main(String[] args){

 ImageIcon Image;  
 Image = new  ImageIcon("picture.gif");
 
 Frame frame = new Frame();

 frame.setIconImage(Image.getImage());
 frame.setSize(500,500);
 frame.setVisible(true);

}
}

mb...
0
 
heyhey_Commented:
but why do you use Swing for such a simple task ?
0
All Courses

From novice to tech pro — start learning today.