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
posted
0
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
posted
0
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
posted
0
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?
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.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.