473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Applet class file cant be modified

Hi Bytes,

i did sample Applet program in linux environment in that place where my java is installed. when i execute the code it creates the .class file and browser shows the result when i load the page. then i have opened the same program again did some modification,made a compilation and run the program but changes didnt affect in the browser. is it the problem in .class regenration? or what could be the problem?. suggest me.

code i used..

<code>
samp.java


import java.applet.*;
import java.awt.*;

public class samp extends Applet{

public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",400,20);
g.drawString(" By PrastSystems",80,70);
g.drawString(" By Java",50,230);

}
}

samp.html

<HTML>
<HEAD><title>Applet In Jsp</title>
</HEAD>
<BODY>
<APPLET ALIGN="CENTER" CODE="samp.class" WIDTH="800" HEIGHT="500">
</APPLET>
</BODY>
</HTML>

</code>
Mar 16 '09 #1
4 2197
r035198x
13,262 8TB
If you are sure the old .class file was replaced then try clearing your browser's cache before running again.
Mar 16 '09 #2
hi thanks for reply.

i did what you have suggested.

But still i am getting the old information in the browser ,updated /modified changes cant be affected.

what cause the program to display the same data(rather than showing the updated information) when page loads in the Browser?

Please suggest me something to tackle this problem.
Mar 17 '09 #3
JosAH
11,448 Expert 8TB
@xtremebass
What happens when you quit your browser and restart it again? It this works you have to flush your cache as has been suggested. If it doesn't you haven't produced a new .class file or it can't be found while the old .class file is still reachable.

kind regards,

Jos
Mar 17 '09 #4
chaarmann
785 Expert 512MB
@xtremebass
It can have different reasons
1.) Maybe you are connecting through a proxy server which caches the old class file.
In this case, configure your browser to bypass the proxy for this hostname under LAN-settings.
2.) Or the webserver (for example Apache) caches the class-file, because you have not configured it to immediately reload changed class files. Try to restart the webserver. If it works afterwards, that was the reason.
3.) Or your browser caches it. Then simply restart of the browser won't work. You have to explicitly tell the browser under internet-option to clear whole cache first, and then restart. There is an option in the explorer to always check for new source and load it instead of getting it from cache. Activate it.

You can also set the expiry time to 1 millisecond with an HTML meta tag in your webpage. Some browsers and proxys listen to that.

Finally, if all doesn't work, just rename your class file. If you don't get an error, then it is still one of the points 1 to 3 that you didn't fix.If you get an error, then you know the cache can't be the reason.
Then try to change the name in the html-page to the new class file name. If the changed version shows up, all is ok. But if the old version shows up, then you know it has to do something with the compilation. In this case:

Did it really compile the new version? Maybe it's still the old class file (check date/size before and afterwards). Did you really save your changes in java file or are the changes only in editor? Does it grab the right java-file and libraries for compilation ? (check path).
Mar 18 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: dB | last post by:
I want to load an applet locally from the client's hard drive from an html/jsp page served by Tomcat on the local machine or a remote server. The motivation is that I need to print to the local...
3
by: yogesh | last post by:
How to store the java applet emebedded in a web page for offline viewing? I saved the web page but it got saved without the applet.and also I searched for the corressponding .class file for the...
2
by: Christian Galbavy | last post by:
Hy! My next problem is to make an applet from my program. I have just add the "extend applet" to my class and removed the main-method by the start-method of the applet. I was thinking that this...
0
by: ankur | last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER MY HttpChatApplet sccessfully Loaded from ChatDispatch but running on some another PC HttpChatApplet not loaded my Coad ...
0
by: crispinternet | last post by:
hi there, well its been 3 days and still i cant find the solution to a problem i have, im on the last bot of a long project and cant seem to get this working. basically i have a signature applet...
0
by: shanmukhi | last post by:
Hi All I got a problem in running java programs. i am not able to run java applet while running i got a problem as Loading Java Applet Failed java.lang.NoClassDefFoundError: App (wrong...
0
by: shanmukhi | last post by:
Hi All I got a problem in running java Applet i am not able to run java applet while running i got a problem as Loading Java Applet Failed java.lang.NoClassDefFoundError: App (wrong name:...
1
by: dishal | last post by:
Can anyone help me please? How do I convert these codes to launch from a JFrame instead of a Java Applet? A simple program where the user can sketch curves and shapes in a variety of...
0
by: dhillarun | last post by:
Hi all, Problem (in short): Disabling the applet cache. Problem (in detail): I have developed an Applet application. I am creating the contents of the applet by reading a text file in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.