This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

icon on JFrame  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Does anybody know how to customize the icon on JFrame?
The default icon is the Java cup on the upper left corner of the
JFrame. I want to change it into my own icon.
Any suggestion would be appreciated.
Cindy
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Use the setImageIcon(Image img) of java.awt.Frame to set your icon in the titlebar.
Eg:
If u r using a Properties file, u may do something like this
setIconImage(Toolkit.getDefaultToolkit().createImage(properties.getProperty("ICON_IMAGEFILE")));
 
Cindy Lyman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. It works and now I have another question.
Do you know if I use imagefile .ico instead of .gif or .jpg?
is anyway to accomplish this?

Thank you again,
Cindy
 
Cindy Lyman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. It works and now I have another question.
Do you know if I use imagefile .ico instead of .gif or .jpg?
is anyway to accomplish this?

Thank you again,
Cindy
 
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally java can only read a .gif or a .jpg image. For some reason, lots of people have been asking about reading .ico files recently, and I finally found a way to read .ico files... Sun has a image I/O library called JIMI ) for managing images.

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!