• Post Reply Bookmark Topic Watch Topic
  • New Topic

Short Question on Frame Icons  RSS feed

 
Patrick ODonnell
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it possible to change the Java icon in the top left hand corner of a JFrame or JDesktopPane?
I know you can use:
.setFrameIcon(new ImageIcon("MyIcon.gif"));
for a JInternalFrame, so I presume there must be an equivalent JFrame one.
Many thanks,
Patrick.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JFrame uses setIconImage(Image image).
 
Patrick ODonnell
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying, but I now have another question.
How is Image used? I have an Icon say 'myIcon.gif'
how do I set this .gif as my Image.
Cheers,
Patrick.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Image myIcon = new ImageIcon("myIcon.gif").getImage();
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!