grant permission within code?
Hi, guys,
I have to modify the java.policy file before I run my applet for the first time.
How can I grant permissions from within my code rather
than manually editing the file (I don't want the client to do anything other than run my applet).
Anybody can help? Thank you in advance.
Janet
[341 byte] By [
kfsong] at [2007-9-26 3:55:22]

I assume you want to perform some protected function and are getting a security error.
You will have to sign your applet to get the rights to perform local operations. You can use a self signed applet, with some issues depending on what version of the JDK/Java Plugin you require.
Anything local is automatically protected as well as numerous other functions like loading classes. Signature allows the user to grant you permission to per form these actions from your applet. The user then has the choice of always granting perrmission, so they only ever get prompted once.