• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java applet file access

 
bolun liu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

what code and procedures are required to use file access in a java applet?

i only need it to work in applet viewer
[ May 25, 2006: Message edited by: wslop ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "wslop"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, Appletviewer often (though not always) runs applets without the security restrictions that a browser would enforce. It would be worth a try to see if file I/O isn't possible out of the box.

If it's not possible, then there are two ways to give applets access to the file system, digital signatures and policy files. Both are described in this wiki page.

But this begs the question: If the applet isn't run in a browser, why make it an applet at all? It could just as well be a regular application, could it not?
 
bolun liu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am doing this for a school project, and i just want to be able to read and write information into a file. i've read numerious guides on the internet, and i have no idea what they're talking about. I know how to use file access in an application, but i need to do it in an applet, which is a pain. I just want to know the syntax for it to work, and whatever else is needed to make it work
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File access in applets uses the same code (and syntax) you would use in an application. But you need to work around the security restrictions. Read the wiki page, and see if that makes it clearer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic