This week's book giveaway is in the Python forum.
We're giving away four copies of Hello World and have Warren & Carter Sande on-line!
See this thread for details.
Win a copy of Hello World this week in the Python 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:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

icon on JFrame

 
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 Spring Java
  • 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
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!