Sign in to follow this  

Need help converting java application to applet

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$ Source) at Source) Caused by: access denied ( 1.jpg read) at Source) at 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>( at appleter.<init>( 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this