Security Restrictions for Applets
Since applets can be embedded in any web page, they could execute on your computer any time you surf the web. Therefore, some security restrictions are placed on applets by the web browser, to stop the applet from doing any harm to your computer. Some of these restrictions are as follows:
an applet can not close down the web browser it is executing in, hence it can not execute the 'System.exit' method | |
an applet is prevented to write anything to the local disk of the computer it is executing on | |
an applet can only read documents located in 'web space' | |
an applet can only read from the machine where the applet came from | |
an applet can only connect to servers on the machine where the applet came from |
Standalone programs do not have these security restriction. Therefore, if you need to create a program that saves data to a file, you have two alternatives:
write a standalone program in Java. Such programs can read and write to the local disk just as any other programs can |