• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I insert an image on the top left hand corner on a JFrame

 
Mario A. Villamizar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me?
I need to display a an Image on a JFrame,
many thanks.
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi if u like to replace the default coffee cup icon with ur custom image,then u do this..
ImageIcon img = new ImageIcon("c:/images/x.gif");
myFrame.setIconImage(img.getImage());
Raj
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!