Applet not refreshing in browser

I wrote a HelloWorld applet and viewing it through internet explorer. when i modify the code, compile it, then it replaces the original .class file, but when i refresh the browser, it loads the original applet. when i delete the .class file from the directory, the applet still shows up on the browser after i refresh it. whats going on? and how do i update the applet.

you hafta CLOSE the browser and then re-open it so the VM sarts up again

Similar Messages

  • Applet not viewable in browser

    Hi
    applet not viewable in browser any website that uses java code seems not to run on my browser though it runs normally well on my friends computer. The browser shows a screen area in grey colour with an error message like "Exception: java.lang.ClassNotFoundException:GUIDemo.class" (im using Win NT4 and IE 5.5) checked the tools/internet options/advanced seettings the browser support is enabled. tried installing the newer version of JRE still not working ..Please guide about any settings that need to be modified or how can i fix this problem ..
    Regards
    anant
    [email protected]

    Hi
    Just a thought, but what broswer are you and your friend using? Are they different by any chance?
    There is an inconsistency between browsers and java, and unfortunately it can result in the error you saw.
    Basically, bog standard Internet Explorer uses its own JVM, whereas Netscape, Mozilla, Opera etc tend to use the java plug-in. To make matters worse, if you install the plug-in on a machine that has Internet Explorer installed, it over-rules the Microsoft version to make itself the default (but this can be undone by looking in the Options menu for Java-plugin and un-ticking the box). Give that a try first.
    Another cause that I have encountered was when using NT on a network, which had been configured not to accept Java Applets at all! Are you on such a network, or stand alone?
    Hope that helps.

  • Crystal Report Not Refreshing in browser

    Hi all,
    Am using crystal report for my web application so here am passing my parameter from jsp page
    but it is not refreshing
    For example
    I am select Month=jan my query goes this way.
    Select * from employee where month='jan' group by department order by designation
    when am intially design in eclipse in filter option am selecting 'jan' and when am running in browser am passing the same query with the parameter but here instead of 'jan' am passing month variable where my month variable changes every time according to user choose
    my crystal report is not getting refreshed ..
    hope u understood my problem
    Regards
    Vanishree.B

    Hi Tejomay ,
    I have tried that even after calling refresh() , it ;s not getting refreshed..but if am using signal table in my query  it is getting refreshed .but when am grouping with another table it is not refreshing..
    Regards
    Vanishree

  • Applet not running in browser?

    Hi
    What is the reason why an applet will be running in appletviewer but not in a browser???

    Hi,
    Try out with this html file:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
    <head>
    <title>Example</title>
    <script language="JavaScript">
    function MyToolBar()
    window.open("Login.html","LoginPage","toolbar=0,menubar=0,scrollbar=0,resizable=0,directories=0,width='110%',height='150%'");
    </script>
    </head>
    <body>
    <blockquote>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.1 -->
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) | | (info.indexOf("Sun") > 0) | | (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<Center><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "100%" HEIGHT = "150%" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.1.2" java_CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" ></XMP>
    <PARAM NAME = CODE VALUE = "MyApplet.class" >
    </APPLET>
    </NOEMBED></EMBED></OBJECT></Center>
    <!--
    <APPLET CODE = "MyApplet.class" WIDTH = "110%" HEIGHT = "150%" >
    </APPLET>
    -->
    </body>
    </html>
    Hope this will help you.
    Anil
    Developer Technical Support
    Sun Microsystems Inc,
    http://www.sun.com/developers/support

  • Servlet does not refresh in browser

    Hi,
    If I change a Servlet code, re-compile it and Refresh the browser (Firefox), it does not refresh. I can only get it to refresh if I re-start Tomcat (v 5.5.4).
    Is there a workaround for this please?
    I put the lines:
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
    at the top of my doGet method and this does not work.
    Thanks,
    Hal.

    Hi,
    For classes, you can set the reloadable parameter in your application configuration file (in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory)
    Set it to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
    http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
    For JSPs, you can configure Jasper (in $CATALINA_BASE/conf/web.xml file) and use the reloading parameter.
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html

  • Applets not refreshing

    This is more of an annoyance than anything. When I compile a java applet (from the command line), then try to view it in html, I don't get the newly compiled version of my applet.
    Instead, I get the old version. The only time I get the new version is when I change the .java file name, compile it, then change the applet tag in the html file for the .class. Like I said, a real annoyance.
    Is there something I can do about this? I'm using Xp with firefox 1.5 if that makes any difference.
    I've tried disabling my cache (with a firefox extension), but still the same result.

    No effect.Worth a try though...
    I guess you're familiar with the "appletviewer" tool to run the applet without
    using a browser. You can't use this if you need to interact with the applet from
    within your web page (via javascript or whatever), but otherwise it could get
    round the browser caching the applet.

  • Applet java file not refreshing in browser

    I have an applet that I am updating and I am not seeing the corresponding update when I open the web page. I can manually download the java class file and look inside it and it definitely is the updated file. I have deleted the browser history. (I am running tests with Firefox 3, IE7, and Safari 4 public beta). Is there something else I need to do to make sure the browser pulls in the latest version of the class file referenced in the html?
    Here is the code:
    <HTML>
    <HEAD>
       <TITLE>A Simple Program</TITLE>
    </HEAD>
    <BODY>
       <CENTER>
          <APPLET CODE="SendRequest.class" WIDTH="500" HEIGHT="150">
          </APPLET>
       </CENTER>
    </BODY>
    </HTML>The applet refers to a hard coded URL to read through a urlconnection. It is always reading a file and showing content, but it is not showing the right file. If I change the name of the referenced file in the java program, it looks like the browser has cached the referred file, rather than throwing and error and saying the file doesn't exist.
    Here is the java
    import java.applet.*;
    import java.awt.*;
    import java.net.URLConnection;
    import java.net.URL;
    import org.w3c.dom.Document;
    import java.lang.String;
    import java.io.*;
    public class SendRequest extends Applet {
        @Override
        public void paint(Graphics g) {
            g.drawRect(0, 0, 499, 149);
            g.drawString(getResponseText(), 5, 70);
        public String getResponseText() {
            try {
                URL url = new URL("http://myserver.com/stats/logs/ex20090603000001-72.167.131.217.log");
                URLConnection urlconn = url.openConnection();
                BufferedReader in = new BufferedReader(
                                    new InputStreamReader(
                                    urlconn.getInputStream()));
                String inputLine;
                String htmlFile = "";
                try {
                    while ((inputLine = in.readLine()) != null)
                        htmlFile += inputLine;
                    in.close();
                    return htmlFile;
                } catch (Exception e) {
                    return "Can't get the string.";
            } catch (Exception e) {
                return "Problem accessing the response text.";
    }Any help would be appreciated. I heard that some files may cache more persistently than others, but I don't fully understand the details.
    Thanks,
    Jim

    Check this [document loader example|http://pscode.org/test/docload/] & follow the link to sandbox.html for tips on clearing the class cache. That relates specifically to caching a refused security certificate, but class caching is much the same. As an aside, getting a console can be tricky in modern times (unless the applet fails completely). It is handy to configure the [Java Control Panel|http://java.sun.com/docs/books/tutorial/information/player.jnlp] to pop the Java console on finding an applet (Advanced tab - Settings/Java Console/Show Console).
    Of course there are two better tools for testing applets, especially in regard to class caching. AppletViewer and Appleteer both make class refresh fairly easy. Appleteer is the better of the two. I can tell you that with confidence, since I wrote it. ;-)

  • JSP page not refreshing in browser

    Everytime I edit a JSP file, and try to refresh the JSP in the browser, I don't get an updated version... just the original page that I viewed first. Anyone got a solution?
    I tried deleting the work directory under the %tomcatHome% directory, and that seems to work until I view the page, and tomcat creates this work directory again. So when I try to refresh the page, because the work folder is still there, the page does not get refreshed. Weird... any solutions? Thanks again.

    I'm not sure if your using Tomcat or not but if you are give this a try:
    The ROOT context is the default Web application in Tomcat, and is convenient to use when you first learning about servlets and JSP (although you'll use your own Web applications once you're more experienced). The default Web application is already enabled in Tomcat 3, Tomcat 4.0.1-4.0.3, and Tomcat 4.1. But, in Tomcat 4.0.4 it is disabled by default. To enable it, uncomment the following line in install_dir/conf/server.xml:
    <Context path="" docBase="ROOT" debug="0"/>
    Taken from: http://www.moreservlets.com/Using-Tomcat-4.html#Enable-Root-Context
    This will make the server request a new page every time, not recommended for production apps but for development it will make life easier.

  • Applet not runing in Browser,although it runs in appletviewer.

    Hello! I have created an applet which connects to an Oracle Database executes some queries and after some processing on the data selected it returns the results. When i run the applet using appletviewer everything works fine.(appletviewer -J-Djava.security.policy=C:\folder\mypolicy.java.policy C:\folder\applet2.html is the command i used).
    The code of the HTML file i used is:
    <html>
    <head>
    </head>
    <body>
    <applet code=applet2 archive=applet2.jar width=600 height=600>
    </applet>
    </body>
    </html>
    However when i run the html page(Mozilla Firefox) i get a white page with a frame where Java starts to load and then nothing happens. The frame remains white and i don't see the results that i see when i use appletviewer. I really don't know what is wrong and i would appreciate any answers cause i am new to this.
    Thanx in advance...
    Edited by: lefos987 on May 26, 2009 2:03 PM

    lefos987 wrote:
    appletviewer -J-Djava.security.policy=C:\folder\mypolicy.java.policy C:\folder\applet2.htmlWhen you run it via a browser, how do you propose to get the browser to acknowledge the custom security policy? You can't pass command line arguments to it.
    However when i run the html page(Mozilla Firefox) i get a white page with a frame where Java starts to load and then nothing happens.It likely threw an exception, which you can get the detail of via the browser if you look for something like "Show Java Console".
    Another note: The applet viewer runs in a different security model than browsers do, so if your applet is trying to access resources on the client machine, the browser isn't going to let that happen. In this case, probably it shouldn't be an applet in the first place.

  • Applet not working in browser, works with appletviewer

    Hi,
    I'm trying to use an Applet program from the tutorials which keeps on displaying time in the HTML page:
    import java.awt.Graphics;
    import java.util.*;
    import java.text.DateFormat;
    import java.applet.Applet;
    public class home_page extends Applet implements Runnable {
        private Thread clockThread = null;
        public void init()
        public void start() {
            if (clockThread == null) {
                clockThread = new Thread(this, "Clock");
                clockThread.start();
        public void run() {
            Thread myThread = Thread.currentThread();
            while (clockThread == myThread) {
                repaint();
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e){
                // the VM doesn't want us to sleep anymore,
                // so get back to work
        public void paint(Graphics g) {
            // get the time and convert it to a date
            Calendar cal = Calendar.getInstance();
            Date date = cal.getTime();
            // format it and display it
            DateFormat dateFormatter = DateFormat.getTimeInstance();
            g.drawString(dateFormatter.format(date), 5, 20);
        // overrides Applet's stop method, not Thread's
        public void stop() {
            clockThread = null;
    }When i use this program in the browser, i cannot see the clock but i'm able to see only a gray box. I'm using the applet tag within the HTML page.
    I can see the same compiled applet running successfully with appletviewer program.
    Please help me out of this predicament.
    -Manish

    I have recently had the same problem, after lots of searching, I found that only Java 1.1 is supported by browsers, leaving out everything else including swing. So if you cant play the applet through your browser you need to download the appropriate patch i think about 5mbs.
    You should find one at java.sun.com/getjava/download.html
    Mine worked fine afterwards

  • Applet not showing in browser OR appletviewer window not appearing

    hi
    1. I have small java code - hello.java
    import java.awt.Graphics;
    public class hello extends java.applet.Applet
    public void paint(Graphics g)
    g.drawString("Hello java...................",600,300);
    which correctly compiled
    2. then I wrote an html file - hello.htm
    <HTML>
    <HEAD>
    <TITLE>HELLO</TITLE>
    </HEAD>
    <BODY>
    <appllet code="hello.class" width=400 height=400>hello not supported
    </appllet>
    </BODY>
    </HTML>
    3. but F:\javacode>appletviewer hello.htm not showing appletviwer window
    command prompt move to F:\javacode>
    4. opend the hello.htm through browser, "hello not supported " appearing instead of applet
    5. both files in same folder
    6. I am using IE8 & firefox (XP sp2)
    wh

    Quite apart from which a String drawn at [600, 300] wouldn't be visible in an Applet of width 400.
    db
    edit
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    Edited by: DarrylBurke

  • Applet not opening in browser  Help needed

    Hi experts,
    I have Java installed in my machine in the path C:\Program Files\Java
    While trying to open the link http://www.radinks.com/upload/applet.php in browser, I am being asked to install the missing plugin and that plugin is java.
    I do not know why this happens and I am stuck with this problem for sometime.
    Any help in this regard will be well appreciated with dukes.
    Thanks in advance,
    Kind Regards,
    Anees

    faheemhameed wrote:
    I have the same issue. But this is on Internet Explorer 8. Firefox is fine.Given the [web page does not validate|http://validator.w3.org/check?uri=http%3A%2F%2Fwww.radinks.com%2Fupload%2Fapplet.php&charset=(detect+automatically)&doctype=Inline&group=0] *(<- link),* I am not surprised it fails in some browsers while working in others. Checking the source of the page itself, I notice the applet is embedded in the page using an OBJECT element only, and that possibly also explains why it works in some browsers but not others.
    The best bet of the author of the web page is to defer writing the applet element to the [deployJava.js|http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit] *(<- link)* that is provided by Sun.
    Unfortunately there is little that you can do about it, unless you want to attempt creating a page to load off your hard disk, that is valid and workable for IE. I cannot guarantee it will work, but try this variant..
    The altered web page, which can be tested at [http://pscode.org/test/radinks/applet.html].
    <html>
    <body>
    <applet
      code="com.radinks.dnd.DNDAppletPlus"
      archive="dndplus.jar"
      codebase="http://www.radinks.com/upload/"
      width= "290"
      height= "290"
      alt="Java is recognised, but disabled!">
        <param name="url" value = "http://67.131.250.110/upload.php">
        <param name="message" value="http://www.radinks.com/upload/init.html">
        <param name="name" value="Rad Upload Plus">
        <param name="max_upload" value="10000">
        <param name="encode_path" value="yes">
        <param name="translate_path" value="yes">
        <param name="full_path" value="yes">
    This browser does not recognise the Java APPLET element.  Get Java from www.java.com.
    </applet>
    </body>
    </html>

  • Applet not refreshing in internet explorer 7

    Hi there,
    I have an application that works fine in IE6 but does not work under IE7.
    The applet reads a text file every minute, this text file is refreshed also every minute.
    I have found out that if you press x in the Java console to clear the classloader cache, the applet does read the tekst file once more.
    Is there anything that can be done to this application to make it work under IE7?
    See code below.
    Thanks in advance for your input / feedback,
    Kind regards, Sharief.
    Code:
    import java.applet.Applet;
    import java.awt.*;
    import java.io.*;
    import java.net.MalformedURLException;
    import java.net.URL;
    //import java.util.*;
    public class VoiceWebQ extends Applet
    implements Runnable
    public VoiceWebQ()
    FileToRead = "WinWebQ_data.txt";
    refreshRate = 5;
    public void init()
    width = 220;
    height = 50;
    resize(width, height);
    String s = getParameter("FileToRead");
    if(s != null)
    FileToRead = new String(s);
    public void paint(Graphics g)
    g.setColor(new Color(89, 169, 222));
    g.fillRect(0, 0, 220, 50);
    g.setColor(new Color(204, 204, 204));
    g.fillRect(0, 50, 220, 10);
    g.setColor(Color.WHITE);
    g.setFont(new Font("Arial", 1, 14));
    g.drawString(firstMessageStr, 10, 18);
    g.setFont(new Font("Arial", 1, 14));
    g.drawString(secondMessageStr, 10, 40);
    g.setFont(new Font("Arial", 3, 9));
    g.drawString("� @Voice Applications WebQ v.1.1", 10, 58);
    public void start()
    if(readThread == null)
    readThread = new Thread(this);
    readThread.start();
    public void run()
    while(Thread.currentThread() == readThread)
                   //classCache.clear();
    readFile();
    try
    Thread.sleep(1000 * refreshRate);
    catch(InterruptedException interruptedexception) { }
    public void stop()
    Thread thread = readThread;
    readThread = null;
    thread.interrupt();
    public void readFile()
    URL url = null;
    InputStream inputstream = null;
    BufferedReader bufferedreader = null;
    try
    url = new URL(getDocumentBase(), FileToRead);
    catch(MalformedURLException malformedurlexception)
    System.out.println("Malformed URL ");
    stop();
    try
    inputstream = url.openStream();
    bufferedreader = new BufferedReader(new InputStreamReader(inputstream));
    int i = 0;
    do
    String s;
    if((s = bufferedreader.readLine()) == null)
    break;
    if(i == 0)
    firstMessageStr = s.trim();
    i++;
    if(i == 1)
    secondMessageStr = s.trim();
    } while(true);
    catch(IOException ioexception) { }
    finally
    if(bufferedreader != null)
    try
    bufferedreader.close();
    catch(IOException ioexception1) { }
    if(inputstream != null)
    try
    inputstream.close();
    catch(IOException ioexception2) { }
    paint(getGraphics());
    String FileToRead;
    Thread readThread;
    int refreshRate;
    int width;
    int height;
    String firstMessageStr;
    String secondMessageStr;
    //private Hashtable classCache = new Hashtable();
    }

    You might want to check which version of java plug-in is used in your client machine.
    We have a similar applet application which works fine for JRE 1.5 or below. However, it stops refresh for JRE 1.6. It seems to me it is a Java 1.6 bug.

  • Applet not showing on browser even if its loaded

    I have created an applet which has some textfields and buttons.
    But when i want to see the applet in browser , it says it has been loaded but shows nothing. i have used swing for applet creation.
    help me out of this.

    What browser? What HTML code?
    Email me and I'll send you an article I've written on this subject. It is NOT as simple as it was 10 years ago.
    You'll need to use <APPLET> for macintosh, <EMBED> for MSIE and <OBJECT> for Netscape/Mozilla/Firefox/Opera. Then you'll need to understand 'code=' (see my reply to CleopatraL).

  • Applet - not rendering n Browser - Mozilla / IE - Help

    Hi,
    I have following code in AnotherHello.html in
    <html>
    <body>
    <applet code="AnotherHello.class" width="300" height="150"></applet>
    </body>
    </html>and the following in AnotherHello.java
    import java.awt.*;
    import java.applet.Applet;
    class  AnotherHello extends Applet
         public void paint(Graphics gr)     
              setBackground(Color.lightGray);
              gr.drawString("Hello", (300/2 - 40/2), (150/2 + 40/2));
    }When I run it using Mozilla or IE it only shows the HTML code in the browser, it does not get me the applet on to the screen. Could somebody help me in figuring out the problem.
    Thanks in advance.

    I have only these two browsers so dont know about
    other browsers.
    No it does not run in applet viewer also.
    I have the class file compiled in the same directory
    as in the java and the html file.
    I am able to see applets from various websites in my
    mozilla browser, which would mean that applet is
    enabled.
    I am not sure what could be the problem.
    Please do let me know.Sounds like it should run then. Maybe it is, but what it's drawing is "invisible" - what about removing that setBackground call, or set it to a different color. If you get a different result, then it is running.

Maybe you are looking for

  • Confusion between references in recursion

    Hi all, I am trying to create B+ trees for a database. My algorithm for the insert function is: void insert(page_no, entry, newchildentry ) if page_no is not a leaf ,say N find i such that Ki <= entry's key value < K i+1   //choose subtree insert(new

  • Update out_tab data in editable ALV

    Hi, I am working on editable ALV using oops. I want to insert the data into database tables after user insert the data in ALV based on the application tool bar button action. How to refresh the data in out_tab, If user click the application tool bar

  • Floppy doesn't work...

    I just built a system with the KT2 Combo motherboard, but I have one small problem--the floppy drive won't work with it. The bios recognizes it (on either primary or secondary cable hookup), and it works perfectly in another system, but it doesn't wo

  • Problem in receiving the internal domain mail through windowsmail, Outlook, Outlook Express

    Hi, Am not able to receive the internal domain mails in Windows mail,Outlook Express, Outlook. I can able to send and receive the mail for external domains. For Eg. My domain name is example.com & my email id is [email protected], i am sending a emai

  • Startup mount error

    when trying to mount the database for performing flashback gives shutdown immediate SQL> startup mount; ORA-01041: internal error. hostdef extension doesn't exist