1) Unless I terminate the JVM with the task manager, I can't see the changes in the applet code reflecting to the related applet inside an html page.
This does not happen if I test the applet via the commandline appletviewer, where I can see the code changes.
Is there any settings I'm missing ? Should I always terminate the JVM in order to see the changes I've made in code ? ( obviously I compile the applet code after the changes, and reload the html page. )
2) My applet connects to a local MySql database. It works only in this way: appletviewer -J-Djava.security.policy=grantacc.txt testapplet.html where grantacc.txt is a grant text file. The question. How to make it work without using appletviewer ? I mean, how can I provide the security policy file to an applet that runs inside an html page ?
#1: The JVM must be terminated in order to see class changes. With appletviewer that happens automatically because it is restarted every time, but with a browser, you need to do that manually. Generally it happens if you close the browser.
#2: The Java Plugin control panel may have an option to let you pick a policy file. If it doesn't, then you may have to alter the system-wide file (which is somewhere in the JRE installation directory).
People don't usually use policy files for applets which are going to be widely distributed. And if your applet isn't going to be widely distributed, you should really consider writing an ordinary Java application and distributing it via Java Web Start.
(You should consider that even if it is going to be widely distributed, too. There are reasons for writing applets but not nearly as many reasons as you might think.)
Everybody's invited. Except this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop