File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes closing !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "closing !!" Watch "closing !!" New topic

closing !!

asheet anand
Ranch Hand

Joined: Nov 15, 2000
Posts: 83
Imagine you have an applet running under a window of IExplorer and that applet open a new window(Frame). How can I close that applet window(applet context) and frame too from that frame?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

I think that you would have to close the browser window with JavaScript. I don't know of any function in pure Java to close the browser window because it is not a Java generated window... If you need help on interacting with JavaScript, there is a good tutorial here.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
asheet anand
Ranch Hand

Joined: Nov 15, 2000
Posts: 83
well MR. Manfred Leonhardt you did'nt help me last time i hope you have a answer to this question.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
I think Nathan already answered your question. You can't close a browser from an applet. If you want to close a java frame just use:
Frame f;
asheet anand
Ranch Hand

Joined: Nov 15, 2000
Posts: 83
thankx for ur advice but i have solve this just go and have a cup of coffee..
I agree. Here's the link:
subject: closing !!
Similar Threads
embedding awt frames in HTML........
destroying an applet
How to embed Applet into the Browser?