I have narrowed this down. It is the method I use to load images that causes the problem. This runs from any location, but only works for applications:
The following on the other hand. will only execute from the current dir, but works for both applications and applets.
I'm stuck between a rock and a hard place here. If it were just an application, it woulc be okay, but I want to use the component for applets too. I need it to run from any location. (prerequeset of my host). If anyone has any ideas, I appreciate it as always.
When I encountered such problem, I added the .java.policy under the home directory(eg: c:\winint\profiles\<your id>. The following line in the policy file solved my problem permission java.io.FilePermission "<<ALL FILES>>", "read";
Put the image in a .jar file (Ant is quite handy for doing this) with all of your other code then use something like: String imageToLoad = "images/tank_bothValvesClosed.png"; URL url = YourClassNameHere.class.getResource(imageToLoad); Image theimage=Toolkit.getDefaultToolkit().getImage(url); this works for applets or applications
I know you don't HAVE to put them in a jar, but if you are going to deploy your app, putting it in a jar makes a lot of sense and if you're going to jar it up eventually, you may as well get that part working sooner rather than later. Does that win any run-on sentence awards? Brian