Results 1 to 2 of 2
  1. #1
    Krooger is offline Member
    Join Date
    Nov 2008
    Posts
    43
    Rep Power
    0

    Default 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?

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    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.

Similar Threads

  1. Scrolling Applet Pictures Disappeared After Update.
    By MrPitBull in forum New To Java
    Replies: 10
    Last Post: 04-05-2009, 12:21 AM
  2. Avoiding refresh
    By java_srinivasan in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 06-25-2008, 09:01 AM
  3. refresh JPanel
    By olesja in forum AWT / Swing
    Replies: 1
    Last Post: 04-16-2008, 03:58 PM
  4. How to Refresh the same page by JSP
    By AbuAziz in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 12-10-2007, 04:06 AM
  5. Refresh session
    By cachi in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •