Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

closing browser widow from applet - hangs!!!

 
Amit Mathur
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys, i have a problem at hand with closing browser window in JRE1.4.1 !
What happens is i have a sort of back btn in my applet. In that I have used a JOptionPane.showConfirmationDialog() to promt the user if he wishes to close the applet or not. Then i called a new close.html which has javascript:window.close() in its onload :
--------
java.applet.AppletContext lbrowser = getAppletContext();
try {
lbrowser.showDocument(new java.net.URL("http://localhost/close.html", "_self");
} catch(Exception e ) {}
--------
But this code hangs after a few tries! No exception is thrown.
anybody encountered this before ???
try it with jre1.4.1 and IE5 or above.
Also tried it with :
-------
JSObject mobjJS_ = netscape.javascript.JSObject.getWindow(this);
mobjJS_.call("closeme",null);
------
where closeme() is a javascript function in the html loading the applet...but to no avail!
 
Amit Mathur
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No replies ! well I tried running the window closing code in a seperate Thread..and it seems to work..but has anyone got any ideas on this???
 
It's exactly the same and completely different as this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!