I am trying to build a java applet which downloads a file to the client machine. As a java application this code worked fine but when I tried as an applet it does nothing. I
See this question,
Self Signed Applet Can it access Local File Systems
I believe it will help you, you need to write your code to use PrivilegedAction.
http://docs.oracle.com/javase/1.4.2/docs/api/java/security/PrivilegedAction.html