Click to See Complete Forum and Search --> : Changing the Application Icon
Stephen L. McConnell
February 23rd, 1999, 04:30 PM
How does one go about changing the Icon that appears in the upper left hand corner of the application once it is running? I feel it must have to do with setting up an image with an "java.awt.Image" class then using Frame.setImage() ,
but am not sure where one does this and if it will mix with Swing???
thanks in advance..
Steve Mcconnell
(not the one who wrote Code Compelete)
R.Karunanithi
February 23rd, 1999, 11:50 PM
hai,
use Frame.setIconImage(Image image) to set the application icon image.this image also appears when the application is iconized.but the iconizing the application is not supported by all platforms
Bye
luv,
R.Karunanithi
R.Karunanithi
February 23rd, 1999, 11:53 PM
hai,
use Frame.setIconImage( Image image)to set the application image.
this image is also displayed in the task bar when the application is iconized.
but all platforms doesn,t support the concept of iconizing the window
Bye
R.karunanithi
Stephen L. McConnell
February 25th, 1999, 05:42 PM
I had stated in the original post that I needed to use the
Frame.getIconImage(Image image) method.... however this method requires that
I create the Image.
In referring to the Image class in the AWT docs, it says that this class cannot be directly instantiated, but must be instantiated through a call to
Component.createImage(ImageProducer imageProducer) (Component is a subclass of
Frame)..... Then, I tried to go to the .awt.image package and understand the ImageProducer and then it referred me to the ImageConsumer object.....
Wait!!!!!
I want to create an image that I can place in my frame to replace the "Application" Icon (not an applet) in the upper left hand corner..... Why is this so hard?
Is there something I'm missing?
Please help....
Stephen L. Mcconnell
Stephen L. McConnell
February 26th, 1999, 08:48 AM
Ok... I've done some more digging. In the Sun Tutorial Documentation, it explains how to instantiate an Image from within an app.... One uses the
"Toolkit" class. In the initialization of my Application Frame, I inserted the
following code. I stepped through in debug mode and it executed both of these commands correctly. (The setIconImage() is a void syncronized Method so I had to place it in a method that throws an exception).
Image icon = this.getToolkit().getImage("whatever.jpeg");
this.setIconImage(icon);
icon was instatiated to a "WImage" (I am guessing the toolkit -- which is supposed to implement a Toolkit for the particular platform I'm working on -- grabbed the Windows platform). So, it does find the image and instantiate it.
However, when I run this, the little coffee cup brewing in the upper left hand corner of my application does not change.
This would seem like a simple thing, since so many other apps change this...
What is going on?
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.