This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes can I put data files into jar for applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "can I put data files into jar for applet" Watch "can I put data files into jar for applet" New topic
Author

can I put data files into jar for applet

kimi chen
Greenhorn

Joined: Jan 03, 2002
Posts: 1
Hi,
Recently I had wrote a applet as a menu in Browser. I put all classes into jar and it worked well but if I put a data file ( for example, a xml file or a image file ), then I got an error that told me the files not be found.
I used java-plugin and the tag "object".
I tried to use jar because it's convenient to jar all dependent libraries.
Kimi
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Images should not be a problem - you use loadImage and getDocumentBase(). I don't know about files in general (although if a image file can be read it seems like other files could be read as well). However, you might be better off using a properties file instead of an XML file. They were supported in earlier releases and don't need additional class libraries to be parsed.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: can I put data files into jar for applet
 
Similar Threads
PLEASE HELP!!! Applet not found Exception
An Applet to contact a different server than it was downloaded from?
applet problem
Applet cant find file
JFileChooser - To use or not to use