I'm sure there is another way to do it, but I'm not sure what it is.
You might want to post this to a new topic if what I suggest doesn't work or is too much work for what you need to do. Is there anyway to get round the security issue? Or perhaps convince the browser that my files are secure? The image is �04.jpg�, not a very good name I know, and it's inside a folder called �Images� and that is inside the �Code� directory, that's the one with all the classes in.Īnd it the Backdrop tester applet I am loading it like this:īackImg=ImageIO.read(new File("Images"+parator+"04.jpg")) The rest of the applet loads up fine, but the image is missing. The reason for using this is because the DirTree class uses a JFileChooser class (it opens a directory root into a tree) and when I tried running the applet in applet viewer I got an assess denied exception, I have another applet (Backdrop) and I even get an java.io.filePermission exception just by trying to read an image, and almost all of my applets use images.Īnother strange thing is that when I run the Backdrop applet from the same directory, so in the applet viewer tags the codebase=��, it loads the image fine. Thanks, it seems to work, I've had to use a different example, I'm know using my search component tester.
If anyone could help with this that would be grand, the aim of this website if to show off my Java knowledge gained from my course, but if I can't get a simple applet to run, one might question that knowledge It all looks well to me, but when I view the page in FF 2 I just get a very unhelpful cross in the top left of the applet area.
}The applet and the jar have been made in Eclipse Version: 3.2.2 if that matters at all, the package code is also lower case, but I don't suppose that matters when the things compiled. Public class DirTreeTester extends JApplet The code in DirTreeTester is very short so I might as well paste it here: I'm trying to run a Java applet that depends on an external jar to run, my html is here:Īs one can see, the jar file is located in the parent's Code directory, and the applet (DirTreeTester) is located in the present folder's Code directory.