• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

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

Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,

Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#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).
Posts: 24594
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!