wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Getting rid of Java Icon on the upper left hand corner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting rid of Java Icon on the upper left hand corner" Watch "Getting rid of Java Icon on the upper left hand corner" New topic
Author

Getting rid of Java Icon on the upper left hand corner

Wilson Mui
Ranch Hand

Joined: Apr 09, 2003
Posts: 140
I know there is a way to get rid of that Java Icon on the upper left hand corner of your apps, but I can't, for the life of me remember how to do it. Can somebody please let me know how to do that if they know. Thanks.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

setIconImage(Image)


GenRocket - Experts at Building Test Data
Wilson Mui
Ranch Hand

Joined: Apr 09, 2003
Posts: 140
I tried to setIconImage() in the JFrame to null, but nothing happened? I thought maybe when I minimized it on the taskbar, then there would be no java icon as well, but again, there was no affect. Does anybody have any ideas as to how to get rid of that java icon on the upper lefthand corner of your apps, when using the MetalLookAndFeel?
Viswa Laksh
Greenhorn

Joined: Apr 30, 2003
Posts: 9
setIconImage(Image image)
image parameter should not be null. If it is null, it will take the default image (java symbol). Try to give your own image.
~Viswa
Wilson Mui
Ranch Hand

Joined: Apr 09, 2003
Posts: 140
Ok, this may sound stupid but how do you create an Image. The Image constructor doesn't seem to have any type of request for an external data input. The only way I've ever used an image was doing this:
Image testImage = new IconImage("[file_name]");
but I'm not sure if that is the way you're suppose to do it. I just don't see what Image is good for? And furthermore, I don't even think IconImage extends Image, so how come this works? Can somebody help me out a little?
Scratch that I never used Image before, it was always a straight up ImageIcon. So how do you use Image then?
[ May 26, 2003: Message edited by: Wilson Mui ]
Viswa Laksh
Greenhorn

Joined: Apr 30, 2003
Posts: 9
Create a URL object and getResource of a image file. I think this following code snippet will help you.

Here
YourClass - Your Current program name.
someimage - file path of some image. e.g "images/smile.jpg"

~Viswa
Wilson Mui
Ranch Hand

Joined: Apr 09, 2003
Posts: 140
hmm, interesting, so it looks like the only way to get a handle to an Image, is through an ImageIcon. I didn't know that. But is there a way then to create an Image from "scratch" sort of speak. I mean to acutally use a constructor to create an Image object?
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Nope... Image doesn't have a (public) constructor. In addition to creating an Image using ImageIcon, there are also several createImage() methods in java.awt.Toolkit and getImage() methods in java.applet.Applet. If you are using JDK 1.4 there is also the new ImageIO API. And if you want to create an Image and not just load one from a file, you can use the BufferedImage class. It comes with a constructor.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting rid of Java Icon on the upper left hand corner
 
Similar Threads
icon on JFrame
Application Icon
JOptionPane
JInternalFrame Icon
How to change the icon on the top left side?