Results 1 to 2 of 2
- 12-26-2009, 07:54 AM #1Member
- Join Date
- Nov 2008
- Rep Power
Why does refresh not update applet?
Im just getting into the applet world and was wondering why it is that if I load an applet, then I update the .class files and press refresh the applet will not show the new changes, I must close my browser and open a new one to see the changes. On some browsers that wont even work! Some browser I would even delete all .class files and the browser would still load it, I guess its stored it in cache or something?
- 12-26-2009, 09:00 PM #2
Yes, thats likely what is happening, the class is being loaded into the Java VM inside the browser plugin, and this VM doesn't get restarted by reloading the page.
So changing the applet code, deploying the code, and reloading the page, would cause the applet to execute the class that has already been loaded by the java vm from the previous applet invocation, instead of fetching the new things as expected.
Unfortunately, without closing and restarting the browser, there is no convenient way I know of (without getting into complicated buildinga custom class loader) to have the applet classes reloaded every time the browser is reloaded.
I used to like to use to use the 'appletviewer' to test applets as I developed them, it is a command line ran tool that simulates what and how an applet would run inside a browser.
Another idea I used to try was to create a Swing JFrame launcher, as the outer wrapper for the inner components that eventually go into the applet. So that most of the screens and things that would change a lot as I built them, I could launch from a stand alone java process to see how they look and work, and once in a while do the full deploy into the web server and see how the applet works in the browser. This is more of a thing to do in your code convention, and doesn't always even work, its difficult to do if there the applet expects applet parameters, or hard to see how things look if the layout of the applet is important.
- By MrPitBull in forum New To JavaReplies: 10Last Post: 04-05-2009, 12:21 AM
- By java_srinivasan in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 06-25-2008, 09:01 AM
- By olesja in forum AWT / SwingReplies: 1Last Post: 04-16-2008, 03:58 PM
- By AbuAziz in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 12-10-2007, 04:06 AM
- By cachi in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 08-07-2007, 07:52 AM