File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

Issue while loading images.

Bhakta Pradhan
Greenhorn

Joined: Nov 26, 2010
Posts: 22
Hi,
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: 498

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
Greenhorn

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


[pic2.JPG]

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
Greenhorn

Joined: Nov 26, 2010
Posts: 22
Hi,
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
Sheriff

Joined: Oct 27, 2005
Posts: 19783
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: Issue while loading images.