• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Problem with getResource() in Eclipse

 
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been using this code for years

But suddenly getClass().getResource("/com/resources/arrow_top.gif") is giving me a null value. I have no idea what I have done wrong with the application. If worse comes to worse, I can rewrite the codes in several ways, but there are hundreds of lines; I wish I could find a solution.
 
Master Rancher
Posts: 5112
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What has changed?
 
Bartender
Posts: 15737
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please show us the directory structure of your project, and highlight where your image is located.
 
Alejandro Barrero
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately I cannot display images, so I have to type the structure of the application
Paperless Office
   src
       com.help.utils
       com.orm
       ....
       com.resources
           action_add.gif
           ...
           arrow_top.gif
           ...
   bin
       com
           help
           ....
           resources
               action_add.gif
               ...
               arrow_top.gif
               ...


 
Norm Radder
Master Rancher
Posts: 5112
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

But suddenly getClass().getResource("/com/resources/arrow_top.gif") is giving me a null value.


What has changed?  If nothing has changed, programs continue to work the same way as before.
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic