Results 21 to 26 of 26
- 06-16-2011, 05:28 PM #21
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
- 06-16-2011, 05:33 PM #22
It's basically the first thing that popped up when I searched for how to access files in JARs, leaving out the applet bit. It worked for the application, so I kept it there. Kinda considering switching it over to what the applet uses though, to keep it consistent.
- 06-16-2011, 05:47 PM #23
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
class.getResourceAsStream() is the standard.
I don't think I've ever seen the ClassLoader one used in any project I've worked on.
- 06-16-2011, 05:47 PM #24
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
One or the other of us needs an avatar...:)
- 06-16-2011, 06:01 PM #25
I'm all for using standards, so class.getResource() etc it is then! Seems to work just as well, both for images and normal files (and using the same path names to boot, which is always a positive).
- 06-16-2011, 06:03 PM #26
Similar Threads
-
reading files from online applet
By mickmos in forum Java AppletsReplies: 0Last Post: 12-02-2010, 01:21 AM -
Reading external text files from an Applet
By Arnold in forum New To JavaReplies: 2Last Post: 01-07-2010, 06:43 PM -
Reading/Writing files through Applet
By Java Tip in forum Java TipReplies: 1Last Post: 03-09-2009, 11:45 AM -
Saving and Reading files on hard drive from an applet
By DenniGa in forum Java AppletsReplies: 0Last Post: 02-26-2009, 03:13 AM -
Applet - reading text files packed into JAR file
By Java Tip in forum Java TipReplies: 0Last Post: 02-08-2008, 09:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks