• Post Reply Bookmark Topic Watch Topic
  • New Topic

Replacing the "java cup" with own image in title bar

 
Marcus Hathaway
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, does anybody know how to replace the java default coffee cup with your own image in the title bar?
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setImageIcon method in the JFrame class can be used to change the icon displayed when the window is minimized - I don't know if this affects the title icon or not too.
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marcus,

Here is the code.
----------
ImageIcon iicon = new ImageIcon("c:\logo.gif");
myFrame.setIconImage(iicon.getImage());
 
Matan Mazursky
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"c:\\logo.jpg"
you can't have a \ like that... sorry for the nitpickiness.
"c:/logo.jpg"
also works my experience, Java fixes it.
 
Marcus Hathaway
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brilliant......working now, cheers guys!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!