• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading resources using classloader

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have an applet and I need to load a picture to display in the applet. What I've tried is including the file containg the picture in the jar-file that holds my applet and other classes and then getting the picture using ClassLoader.getSystemResource(filename) and ClassLoader.getSystemResourceAsStream(filename) and that won't work.
Will I need to call the methods of the applets classloader instance instead of the static ones? If so how do I do that?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18108
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This comes out of "Java Examples in a Nutshell" from O'Reilly & Associates (David Flanagan, author). It has been condensed slightly.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, works great
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic