What exactly are you trying to achieve?
Main Topics
Browse All TopicsIs there anyway to prevent an applet from reloading due to a refresh, or to disable the refresh? Thanks experts.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Oh a little more information, I have a frameset with two frames, I have a JApplet in first Frame and a my website in the second one. If I hit refresh though the JApplet in the first page reloads and I don't what that to happen, how can I prevent the first Frame from Refreshing, or else the JApplet from Reloading? Thanks experts.
Kes.
> Oh and I am not reloading through the applet, I am trying to prevent
> the applet from reloading if the user hits F5. I have the Japplet
> spawn some Jframes, but if the user hits F5 then my JFrames will
> disappear. :( I want to prevent this.
You cannot prevent it. F5 loads the whole page. I was thinking that you could send a specific request to the second frame but this is different to hitting F5.
Hi kesea,
JVM generally use applet caches to avoid reload of applet code.
When you hit F5, in fact the applet is stopped and restarted again (stop() and start() methods).
I don't know if it's possible, but you can try to manage the page reloading in the applet like:
public class myJApplet extends JApplet
{
private boolean started=false,initialized=
public void init()
{
if (!initialized)
{
initialized=true;
// ...
}
}
public void destroy()
{
// destroy nothing
}
public void start()
{
if (!started)
{
started=true;
// ...
}
}
public void stop()
{
// don't stop the applet
}
}
It should work if the same applet instance is used when you reload the page. The applet may be hidden during reloading. But reloading should be quicker if you avoid destroying the applet resources and reloading them again.
you can't do anything to stop the applet from reloading since when you hit F5, the browser really destroy your applet and re-initialize it.
since you mantioned JApplet, I assume you are using Sun's java plugin;
at least for later versions (1.4+) , when you refresh - your applet gets a new class loader, so even static fields in your classes are lost -
so storing state in static variables will not work.
you need to somehow store your state persistently when your applet goes does, and reload it when it starts.
if your applet is sigined, you can store state on the disk, if its not - you can store state on the server using some serverside component, its a bit complicated.
Business Accounts
Answer for Membership
by: girionisPosted on 2004-08-28 at 14:40:40ID: 11923322
I do not think you can do it. Only way you can do (and only in IE) is to get an administrator to get rid of everything on the top bar (apart the URL address). But again the user can refresh if he clicks on F5.