Hello! I like to run some applets on my own machine. Of course I trust my own applets, but they like to write to file (same machine) and connect to the sql-server (same machine too) and do a lot of TCP/ IP and UDP connections. I trust all of them, and the involved machines trust too. I'm looking for an EASY way to tell all those machines, that my silly little applet is to be trusted. How do I start? Where can I find a BRIEF instruction? (of course I will have to find out the more complex things later). Looking at the sun docs, I found out how to create a .java.policy - file, but where do I refer to it? In the test.jar? In the test.html with the applet-tag? I found no switch for the appletviewer, nor for java.
One way to do something you want is to build a java-application which USES your applet. U just instantiate your applet and then call yourapplet.init() naturally after adding your applet to the (Frame e.g.) of you application/ Succes Peter
The only problem with this approach is that the browser is responsible for creating much of the environment that the applet runs under, so you'd have to recreate a lot of functionality. (Although there are OpenSource libraries already written to do this.) However, in terms of the *simplest* way to deal with this during development is to use the AppletViewer. What I do, is first create a policy file named "all.policy". The contents of this file are:
Then I create a batch file to launch my applet in the appletviewer using this policy:
"AppletExample.html" is a third file that contains the <applet> tag for my applet I'm testing . (AppletViewer only parses the <applet> tag) code for AppletExample.html:
All three files are in the same folder, btw. You can put your classes wherever you want, just make sure the <applet> paramaters reference the code in the right location. Then when you double-click the batch file, you will be viewing your applet in appletviewer with all permissions enabled. Hope this works for you. [ September 05, 2003: Message edited by: Rob Ross ]