Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

Issue while loading images.  RSS feed

 
Bhakta Pradhan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
Please find the below code.Please let me know what changes shall I make to load the images.PFA below the project structure.
pic1.JPG
[Thumbnail for pic1.JPG]
 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
When using getClass().getResource(), you must put your images under src folder.
 
Bhakta Pradhan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi I moved the images folder into src (PFA).Still images are not getting loaded :-(
pic2.JPG
[Thumbnail for pic2.JPG]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Report post to moderator
Is this any different to your other thread,
the thread with a number of suggestions.
 
Bhakta Pradhan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 21089
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!