• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NullPointerException on getResource() only in browser

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, i'm writing here because i'm really getting sick on a strange problem with my applet...


I made this simple applet:




This is the HTML tag:



The attachment shows what does my jar contain..

The problem is that everytime i try to execute my applet in my IDE, everything works.

BUT: when trying to execute applet in browser, i get everytime a NullPointerException right here:

java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)



That is:



Please can you help me to solve this? I'm really sure the path is correct, what should i do??? Do i have to modify my classpath file or Manifest?

Really thanks for your help.

P.S= Sorry for my bad english, i'm italian.
Immagine.png
[Thumbnail for Immagine.png]
 
Francesco Rizzi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SOLVED... Running the applet from the local file html would have access denied to local files...

uploading the applet on a website everything works, my fault...
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch and thank you for updating the thread with the solution.
 
Francesco Rizzi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Pleasure.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic