Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

All IE windows closing on applet exit.

I currently have an applet which opens when going to a certain URL.  It runs checks and downloads the necessary jar files onto the user's computer.  When exiting the application, I use the command System.exit.

If I have a Internet Explorer open prior to going to the URL, then opening another IE window and accessing my URL from this window, upon exit, the applet closes normally, but also closes all other Internet Explorer Windows as well.  If I had opened another Internet Explorer window after accessing the URL, then that window doesn't close.

My question is, how can I close ONLY the Internet Explorer window from which the URL was accessed from?
0
JK2429
Asked:
JK2429
  • 9
  • 7
  • 5
2 Solutions
 
CEHJCommented:
>>, I use the command System.exit.

You can't use that from an applet as it doesn't

a. make sense
b. have the right permissions

so you remove it first, then we'll readdress the problem
0
 
JK2429Author Commented:
One additional important fact I forgot to mention...
This only occurs if you click on a link from an email such as outlook.
0
 
CEHJCommented:
>>When exiting the application,

(I assume you meant 'applet' as you haven't mentioned an application previously or subsequently)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
JK2429Author Commented:
>>(I assume you meant 'applet' as you haven't mentioned an application previously or subsequently)
Yes, Im sorry for the unclear question.

Upon closing of the IE Browser (which loads the applet) can terminate the applet and close the browser window, or exiting the applet also closes applet and the browser window.

0
 
CEHJCommented:
First of all, as i said, get rid of the System.exit
0
 
JK2429Author Commented:
got rid of System.exit...
0
 
CEHJCommented:
OK. Make sure you after you recompile it that you remove all caches copies of the old version
0
 
JK2429Author Commented:
Done, same thing.  It works if I type the link in IE, but won't work when clicked on from an email from outlook.  It will close all IE windows.
0
 
CEHJCommented:
What Java plugin are you using?
0
 
objectsCommented:
you can use Javascript to close the IE window

one way:

JSObject win = (JSObject) JSObject.getWindow(this);
win.eval("self.close();");

or you could load a page that will close it

<html>
   <body onLoad="window.close();">
   </body>
</html>
0
 
JK2429Author Commented:
>>What Java plugin are you using?
CEHJ, we are using Java JRE 1.4.1

Yes Objects, I was thinking about that option.  If we do go with the javascript option, it will require user actvating ok button on the IE popup message.  "Are you sure you want to navigate away from this page?"

During my research, I had come upon this link: http://www.ozzu.com/ftopic15.html
0
 
CEHJCommented:
Why would you need to close the browser window in Java btw? Why not show the user it's done and leave the user to decide what to do - they might want to check a favourite site for all you know ;-)
0
 
JK2429Author Commented:
We need to close the browser window for those computer users.  They expect all application related windows closed.
I doubt that...  :o)
0
 
objectsCommented:
javascript is the only way i'm aware of.

do your users have the "Reuse windows .." option checked?
0
 
JK2429Author Commented:
No, we have over 3500 users all over the world.  Each have different settings.
0
 
objectsCommented:
you'll possibly need to use activex to achieve your goal, and probably also sign your code.

another option might be to use web start so that no browser window is used in the first place.
0
 
JK2429Author Commented:
Will using web start still allow me to download the neccessary jar files and certificate verification we do with IE?
0
 
objectsCommented:
0
 
JK2429Author Commented:
Thanks (again) objects and CEHJ.  :o)
0
 
CEHJCommented:
:-)
0
 
objectsCommented:
glad my comment helped :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 9
  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now