Results 1 to 4 of 4
  1. #1
    javaken is offline Member
    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Default No change seen in applet despite java code edit and recompile

    Hi,

    I have some programming experience in the past (c/c++), but I am new to Java and applets. Currently, I am trying to learn Java and applets through playing around with a sample 'drawinglines' applet. I compiled the code, generated a class file, and wrote simple html code (referencing the generated class file) to display the applet on a webpage. But when I modify the code (to change the color of the lines and background), saved, and recompiled I don't see the changes reflected in the applet on the webpage after I reload. I tried almost everything I can think of but it doesn't work. Interestingly, I tried deleting the class file, and yet the webpage was still able to run the applet w/o the changes I made (is there a temporary class file stored somewhere that the html code is referencing and I don't have access to?). The only way, it seems, that I can make changes to the applet is if I make an entirely new class (essentially, just changing the name). Even then, I am stuck with those modifications. I can't modify any further. Does anyone know what's going on here?

    Thanks,
    Ken

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: No change seen in applet despite java code edit and recompile

    Some browsers are very "helpful" about caching Java class files. You might (1) look around to see if the browser offers some mechanism for clearing the cache (2) make sure you are reloading and not refreshing (3) use a different browser (as they differ as to what ctrl+R does) or (4) use the appletviewer executable that comes as part of the Java SDK.

    I only write applets infrequently and it's been a while... But those things - and profanity - usually does the trick.

  3. #3
    javaken is offline Member
    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Default Re: No change seen in applet despite java code edit and recompile

    I figured it was a cache problem. I've tried reloading but it doesn't work. I have used Firefox and Chrome. Seems to work if I switch between the 2 browsers and close and reopen the windows, but it's a hassle to have to do that all the time. Couldn't find any options in the browser to customize the caching. I didn't know about the appletviewer, that works just fine. I am happy to use that than waste time trying to load it on the browsers correctly.

    Thanks!

  4. #4
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: No change seen in applet despite java code edit and recompile

    Moved out of staff only section.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 2
    Last Post: 02-19-2014, 05:36 PM
  2. Replies: 2
    Last Post: 02-22-2012, 10:09 AM
  3. Edit jar, see the code, edit code and back it as a jar
    By RichersooN in forum New To Java
    Replies: 1
    Last Post: 10-10-2011, 05:33 AM
  4. I need to edit this code
    By amzers in forum New To Java
    Replies: 14
    Last Post: 01-05-2011, 09:46 AM
  5. Add , edit ,delete code in struts
    By sandy1000 in forum Web Frameworks
    Replies: 0
    Last Post: 12-28-2010, 06:25 AM

Tags for this Thread

Posting Permissions

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