• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

Java applications not working with Sun JVM

Now that XP Service Pack 1A has been installed and we are using the Sun JVM with Internet Explorer instead of the Microsoft JVM, my Java applets not running. The way they used to work was that the menu page would invoke the HTML page that started the applet. Then the HTML page would revert back to the regular menu page, while the applet would continue to function until the user closed it down. Users would start and run several different Java applets in this manner. Now, when the HTML page reverts back to the regular menu page -- which is almost instantaneous -- the Java applet is killed. So, the user barely sees it and doesn't get to work with it. Does anyone know of a way to resolve this problem without leaving the child HTML page still open? I'd rather not have a solution that involves having several frames.
0
jdargan
Asked:
jdargan
  • 7
  • 6
  • 2
  • +1
1 Solution
 
sfotexCommented:
Does the applet itself work with the sun jvm?
Or it works fine with the appletviewer and dies when
you start it the way you described in the browser?
0
 
jdarganAuthor Commented:
The applet works with the Sun JVM. It dies when the HTML page that started the applet navigates to another HTML page. This is not the way it worked under Microsoft's JVM. With Microsoft's JVM the applet continued to run until all instances of Internet Explorer were closed.
0
 
objectsCommented:
> It dies when the HTML page that started the applet
> navigates to another HTML page.

That is expected behavior, otherwise you would end up with your browser running every applet that it encountered in a session.

Sounds like you need to keep a thread running after your applet is shutdown.
What exactly is it that you are trying to achieve?

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
warsqlCommented:
Try putting the applet in a hidden div or layer on the displayed page?
0
 
jdarganAuthor Commented:
I'd rather not have a solution that involves having several frames, even if they are hidden. I'm not sure what the term "div" means.
0
 
objectsCommented:
What exactly is it that you are trying to achieve?

0
 
jdarganAuthor Commented:
I wanted my Java applet to continue working even if the user navigated to a different web page. The applets we have been using are invoked an HTML page, but they use the Java Frame class to apppear separately from the HTML page. With the Microsoft JVM they continue to appear even if someone navigates to another HTML page. With the Sun JVM they disappear the moment someone navigates from the original HTML page to a different page.
0
 
objectsCommented:
For the reasons I stated  above I believe Sun's VM behaviour is correct. That is non-default behaviour which you need to explicitly implement.
0
 
jdarganAuthor Commented:
Thanks, but I'm wondering what to do to implement this behavior without having to keep several hidden frames open for these applets.
0
 
objectsCommented:
As I mentioned in earlier comment try keeping a new thread running. You'll also probably need to maintain a static reference to things so newly loaded applets don't recreate things every time.
0
 
jdarganAuthor Commented:
I'm going to keep this open until Friday to see if I get any other answers. On Friday I'll award points based on whatever answers I've gotten. Thanks to everyone who've provided comments.
0
 
warsqlCommented:
A div is an html tag.  You can put this anywhere in the body of your non-frame page. (Not that you couldn't use it within a frame).
<div style='visibility:hidden'>
<APPLET ...>
</APPLET>
</div>
0
 
objectsCommented:
Not much difference to using a 1x1 pixel applet.
0
 
objectsCommented:
If you're applet is on every page then you could just maintain a static reference to frame and make it visible whenever the applet loads.
0
 
jdarganAuthor Commented:
One of my co-workers suggested a solution that resolves the problem. Each time someone selects a button to start an applet, the button calls a JavaScript function that creates a separate frame using code like this:

<script language="JavaScript">

function SystemAdministration()
{
 var html = '<IFRAME SRC="main/sysadmin.html"><\/IFRAME>';
 document.body.insertAdjacentHTML('beforeEnd', html);
}
0
 
objectsCommented:
Not necessary, but if you're happy with it.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now