This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Applets and the fly likes Closing browser Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Closing browser" Watch "Closing browser" New topic
Author

Closing browser

Mohammad Farhat
Ranch Hand

Joined: Nov 17, 2005
Posts: 51
Hey Guys,
is there a way that i close all open browsers on the client side using an applet code?
also is there a way to restart one browser after that?
the reason behind this is that from my signed applet, i am changing the max memory heap size for the jvm, and i need to close all browsers for the change to take effect, and a nice feature also is to put the user back into the log in page...
Any ideas?
Thanks,
Mohammad
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
Try using the netscape.javascript package


// Mathias


Ps. win.evalutate is not right. Could not post the right tag here


SCJP1.4
Mohammad Farhat
Ranch Hand

Joined: Nov 17, 2005
Posts: 51
Mathias,
thanks for the reply...but this helps in closing simply the current window in which the applet is opened.
What i actually need is to close all instances of the browser currently opened, since this is the only way through which the jvm would be restarted...
Any other thoughts ?
Best,
Mohammad
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
Ok! I don't know if you can loop thru all the browser windows. Try asking this question in the HTML, Javascript forum. If there is a reply that works, put the code in a javascript function and call the function inside the applet.

Mathias
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Closing browser
 
Similar Threads
Browser window and applet frame
Browser closed detection
With Java Plug-in, document.applets.length returns 0
What is a Session's scope?
Loading an Applet Takes Time