JFileChooser write permission



Hi,

I have written a Java applet that I run from the command line
using appletviewer. I used policytool, setting the CodeBase to the
directory with the applet class, and gave "FilePermission," with a
target of <<ALL FILES>>, with permission to "read, write." After using
policytool, I can create a new FileOutputStream, and write to a file,
without throwing an exception (which I could not do before using
policytool). So far, so good.

However, with the same applet in the same directory, when I try to
run

JFileChooser fileChooser=new JFileChooser();

I get a java.security.AccessControlException. Why the difference, and
how do I get around it? I would think that if the security is OK with
opening a file with FileOutputStream it should be OK with opening a
file with JFileChooser. I saw that there were some older posts on this
subject, but was not able to follow them; I am a complete novice on
java security issues.

Thanks for any help you can provide, or any information about where I
can find this information on my own.

Momo

.



Relevant Pages

  • Re: Access Permission
    ... > applet access its directory and any subdirectories on the server. ... I went hunting at Sun for PolicyTool and found this first hit.. ...
    (comp.lang.java.programmer)
  • Re: RMI question - VMID
    ... You can try using the PolicyTool to adjust ... individual browsers to use the applet, ...
    (comp.lang.java.programmer)
  • policytool restrictions
    ... Using policytool, I would like to allow ONLY this applet to be able to read ... only to this single applet) ... Martin ...
    (comp.lang.java.security)
  • how to use the policy tool?
    ... Can anyone please explain to me how to use the policytool in java so that i ... can write from an applet to a text file? ... Please specify the steps in details. ...
    (comp.lang.java.help)
  • Re: Fedora software to process "egg" photographs?
    ... lens manufacturer is ALL you need. ... I would guess that the call to the applet consists of where the applet ... The Java applet is not calling a .jpg file, ... the result of which is a linear estimation of the panorama. ...
    (Fedora)