• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException on getResource() only in browser

 
Francesco Rizzi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
Tony Docherty
Bartender
Posts: 3054
59
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
My Pleasure.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic