• Post Reply Bookmark Topic Watch Topic
  • New Topic

Frame Icon

 
mira yang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any method that can change the cup icon? I mean that once you change the Icon ,the frame has the new icon when you create a new JFrame anywhere?
thanks!
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if there is a global "setFrameIcon()" method that will do it everywhere (I don't think there is), but one easy solution is to write a small class that extends JFrame and sets the icon in the constructor to whatever you want then whenever you want a new JFrame, just use your JFrame class instead of the default JFrame. Quick and easy!
brian
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I use. It also works in an executable jar:
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops...do not put InventoryManager in your code. Should be:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!