Original Post
ok im trying to convert my java application to an applet so I just changed the JFrame to Japplet it worked fine in the applet viewer but in the browser it gave an exception : java.lang.reflect.InvocationTargetException at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source) at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source) at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.security.AccessControlException: access denied (java.io.FilePermission 1.jpg 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 sun.awt.SunToolkit.getImageFromHash(Unknown Source) at sun.awt.SunToolkit.getImage(Unknown Source) at javax.swing.ImageIcon.(Unknown Source) at javax.swing.ImageIcon.(Unknown Source) at Picture.(Picture.java:6) at appleter.(appleter.java:66) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) etc The problem is sometimes it randomly works and other times it doesnt, when im rarely changing the code. Edit: I realized the exception occurs at the point when i use an external image in this specific line: ImageIcon I=new ImageIcon("1.jpg"); if so how do i insert images in applets?