Setting Permissions for an Applet
See Also
By default, applets do not have access to resources on a client's computer, such
as threads and disk operations. An applet's permissions are defined in its applet.policy file.
If you have an applet policy file, you can specify its location in the IDE. Then,
when you run the application, the IDE uses the applet policy file that you specified.
If you do not specify an applet policy file, the IDE generates one for you
when you run the applet. The applet policy file that the IDE generates for you
grants all permissions to the applet. You can use the Source Editor to modify
the policy file, so that appropriate security checks are done.
To specify the location of an existing applet policy file:
- Right-click the project node and choose Properties.
- In the left pane of the Project Properties dialog box, select Run.
- In VM Options, specify the location of the applet policy file. For example,
use the following setting to specify that the applet policy file is in the
project's root folder:
-Djava.security.policy=applet.policy
- Click OK.
To use the IDE to generate an applet policy file:
- Run the applet.
The IDE creates an applet policy file.
- In the Files window, expand the project node and double-click the applet.policy file.
- In the Source Editor, set permissions according to your needs.
- Right-click the project node and choose Properties.
- In the Project Properties dialog box, select Run.
- In VM Options, note that the IDE has specified the location of the applet policy file.
By default, the applet policy file is in the
project's root folder:
-Djava.security.policy=applet.policy
- Click OK.
- See Also
- Creating an Applet
- Running an Applet
- Accessing an Applet from a JSP Page
Legal Notices