aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes icon on JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "icon on JFrame" Watch "icon on JFrame" New topic
Author

icon on JFrame

Cindy Lyman
Greenhorn

Joined: Jun 14, 2001
Posts: 4
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
Shishir Parikh
Greenhorn

Joined: Aug 09, 2001
Posts: 4
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

Joined: Jun 14, 2001
Posts: 4
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

Joined: Jun 14, 2001
Posts: 4
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
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

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


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
Don't get me started about those stupid light bulbs.
 
subject: icon on JFrame