• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting rid of Java Icon on the upper left hand corner

 
Wilson Mui
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setIconImage(Image)
 
Wilson Mui
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic