Forums Register Login

Applet does not reflect the changes in (compiled) source code

+Pie Number of slices to send: Send
Hi ranchers,
I have 2 questions.

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 ?

Any help greatly appreciated,
Sergio.



+Pie Number of slices to send: Send
#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).
+Pie Number of slices to send: Send
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.)
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1123 times.
Similar Threads
how does JVM run a applet
applet related confusion
appletviewer
New class not loading
Start:applet not initialized Error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:23:46.