aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Issue while loading images. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic

Issue while loading images.

Bhakta Pradhan

Joined: Nov 26, 2010
Posts: 22
Please find the below code.Please let me know what changes shall I make to load the images.PFA below the project structure.

[Thumbnail for pic1.JPG]

Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 484

When using getClass().getResource(), you must put your images under src folder.

PM Me If You Want to get Urgent Help on Java Programming
Bhakta Pradhan

Joined: Nov 26, 2010
Posts: 22
Hi I moved the images folder into src (PFA).Still images are not getting loaded :-(


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Is this any different to your other thread,
the thread with a number of suggestions.
Bhakta Pradhan

Joined: Nov 26, 2010
Posts: 22
Ya its similar to the last thread.In last thread I was asking about loading images archived in jar file. As per the suggestion I tried the same in simple program without making jar.But it didn't help. So I thought of starting a new thread to resolve first stage of the whole issue.

Please let me know if there is something to be changed in my program.
Rob Spoor

Joined: Oct 27, 2005
Posts: 19541

I already gave you an answer in your other thread, and I'm not going to repeat it. In fact, this thread will be closed since it's the same problem as your other thread. You should UseOneThreadPerQuestion.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Issue while loading images.
Similar Threads
Reg: Running Swing in Browser
Loading an Image
Issue while loading images packaged in jar
images in jar file