• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read Properties File from Applet.

 
Arun Kumar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to read the properties file in Applet. Is it possible to read the properties file if it is present within the jar (where applet is present)??
Thanks
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Arun,
it is possible to read files from the Jar file u specify in ARCHIVE attribute of the APPLET tag.
say u have a property file called property.txt in a Jar file and u won read it in the applet u can do something like this in ur applet,

here i have assumed that we have applet tag having parameter named "propFile" that contains name of the property file. this is just for little flexibility. u can hardcode the property file name in the applet code as well.
also have a look here which was the primary resource of my code as well...
btw, S.o.p is System.out.println (just in case u don get it!) and that will not print anything on the applet but it will be there in the Java Console of the browser
regards
maulin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic