File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes How to Close an application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "How to Close an application " Watch "How to Close an application " New topic
Author

How to Close an application

anand chawla
Ranch Hand

Joined: Oct 19, 2000
Posts: 91
Hi Guys,
I m making a software for a Cybercafe.
I m opening the internet explorer through a button on frame..created in java.
After 1 hour I want the explorer to close automatically.
is it possible.I think it is please help me.
the second problem is that if i have multiple explorers open,If i want all of them to close automatically after 1 hour...is it possible...please help me.
Thanks
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Maybe the Applet forum would be a better place to get an answer to this question. I'll transfer this thread there.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I don't think you can do this from an applet. I know you can close browser windows from JavaScript, but if you try to use a window.close() on a window that you didn't open with window.open() you will get a dialog telling you that the application is trying to close the window, and is that OK? You could write a JavaScript that handles the closing of the window and call it from your applet. Would that help you?
Charlie Boss
Ranch Hand

Joined: May 22, 2001
Posts: 44
Hi i'm also interested in this answer. Heres my scenario. A user clicks on a link to my applet and it opens another window which holds my applet. My applet is also in a frame.
I currently call window.close() from my applet. However whenever the user goes back to click on the applet link (the previous window) the applet never reloads..
I partially solved this by calling System.exit(0/1) before i called the window.close().. my applet exited AND i had no problem clicking on the applet link to reload it.. HOWEVER the applet browser will still be open.. (my applet is in its own frame)..
when call System.exit(0/1) after i call the window.close() then both windows close.. the browser window holding my applet AND the browser window containing my applet link.
i want to be able to call window.close() so it closes my applet browser window and also call system.exit() so i can reload my applet.


Java Rawks
anand chawla
Ranch Hand

Joined: Oct 19, 2000
Posts: 91
Well Guys You are mistaken,
What i Meant is that I created a Application in java.
which has frame and the button exists on frame.
its not a applet
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Close an application