GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Image won't appear Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Image won Watch "Image won New topic
Author

Image won't appear

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi, I'm trying to load an image into an application in Netbeans 5.0.
The images folder is in the same directory as the .java files.

I don't understand why this code doesn't work.

I've tried changing the path, and changing the extension to .jpg, but it still won't go, doesn't make sense, I've used this method before. Any ideas?
Thanks for any help
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
worksOK for me, .gif and .jpg
colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
I don't get it, it won't work, I tried GIFs too.
Doesn't make any sense
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
try this



if it also fails, you'll know the image (path, name etc) is the problem.
colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi, I finally fixed it, it was the path.
I needed to use...

That seems to work Thanks for your help anyway.
 
GeeCON Prague 2014
 
subject: Image won't appear