I have written an applet in Netbeans and it is working ok.. Now I need to embed this applet in an html file. I have used the following code for doing so :
<Html>
<Head>
<Title>Java Example</Title>
</Head>
<Body>
This is my page<br>
Below you see an applet<br>
<br>
<Applet Code="MyApplet.class" width=200 Height=100>
</Applet>
</Body>
</Html>
Now when i run the html file.. the applet does not run. It gives an error called Applet notinited.
Java console contains this :
java.security.AccessControlException: access denied (java.io.FilePermission C:\postplotter.txt read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileReader.<init>(Unknown Source)
at finalpkg.trial.init(trial.java:54)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Please help. I think the problem is because the applet needs to access this file called C://postplotter.txt
Edited by: sauvikc on Jul 25, 2008 7:33 AM