Does anyone know how to load an image file (GIF/JPG) into an application? I can't seem to find any information on how to do it in a stand alone application, just applets.Help.Please!
Ok. That works. Now I have another question. Is there a way to overload the JLabel class(?) so I can replace one image with another during runtime?(in the same label)
I used this code:
String adfile = "honda.gif";
JLabel Advertisement = new JLabel(new ImageIcon(adfile));
I can't believe I'm doing your work for you. If you want to be a productive java programmer, you absolutely have to know how to find things in the API docs on your own. I had no idea if this could be done, but 5 mouse clicks later I found it in the javadocs for JLabel. Go figure.
You actually have to spend the time and look through them, which it seems you arn't doing. Follow the Sun Java tutorials, they have explained all of your questions so far.