This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Frame Icon  RSS feed

 
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:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!