?
Solved

Java applications not working with Sun JVM

Posted on 2003-02-25
16
Medium Priority
?
211 Views
Last Modified: 2013-11-21
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
Comment
Question by:jdargan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
  • +1
16 Comments
 
LVL 2

Expert Comment

by:sfotex
ID: 8020390
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
 

Author Comment

by:jdargan
ID: 8020566
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
 
LVL 92

Expert Comment

by:objects
ID: 8021015
> 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
LVL 2

Accepted Solution

by:
warsql earned 1000 total points
ID: 8022808
Try putting the applet in a hidden div or layer on the displayed page?
0
 

Author Comment

by:jdargan
ID: 8025006
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
 
LVL 92

Expert Comment

by:objects
ID: 8026967
What exactly is it that you are trying to achieve?

0
 

Author Comment

by:jdargan
ID: 8027328
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
 
LVL 92

Expert Comment

by:objects
ID: 8027405
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
 

Author Comment

by:jdargan
ID: 8027462
Thanks, but I'm wondering what to do to implement this behavior without having to keep several hidden frames open for these applets.
0
 
LVL 92

Expert Comment

by:objects
ID: 8027489
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
 

Author Comment

by:jdargan
ID: 8027591
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
 
LVL 2

Expert Comment

by:warsql
ID: 8029505
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
 
LVL 92

Expert Comment

by:objects
ID: 8029841
Not much difference to using a 1x1 pixel applet.
0
 
LVL 92

Expert Comment

by:objects
ID: 8029857
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
 

Author Comment

by:jdargan
ID: 8044726
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
 
LVL 92

Expert Comment

by:objects
ID: 8044778
Not necessary, but if you're happy with it.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question