Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to read property file from an applet

 
bharani rao
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i have the following code to read and write to a property file in a swing .



i tried the same code in swing but it is not working..
is there a different code to read and write in applets???
i'm running the program in eclipse ---> run as applet.

please advice

thanks in advance.
 
bharani rao
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all.

i got it right this time after trying many examples..

i jus replaced

with

and commented




thank you
 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets can't access the local file system. Instead, store the properties file in the same folder as your HTML file on the webserver and use a URL:
If your properties file should remain read-only, you can also turn it into a resource, and use Class' getResourceAsStream method to get an InputStream to it.


Moving to Applets.


Edit: I just saw you found the solution Still moving.
 
bharani rao
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rob,

thank you for your reply.....

but i solved it myself and posted that i solved it.

i'm not aware your reply is for the solution i found or you are suggesting another method to do so...
both the ways seems pretty similar.....

check out my reply posted just before your reply.
anyways, thank you very much..

 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you missed my edit. I was typing the post, and as I finished it and the page reloaded I saw your solution. And a good solution it is
 
bharani rao
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic