• Advertisement
Sign in to follow this  

Need help converting java application to applet

This topic is 2996 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.<init>(Unknown Source) at javax.swing.ImageIcon.<init>(Unknown Source) at Picture.<init>(Picture.java:6) at appleter.<init>(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?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement