I have a JAVA applet that brings up an application modal dialog. The problem I am having is that the user can close the browser (or tab) and the dialog will remain up. If you click on the IE9 window area or menu bar the dialog appears modal, but when you click on the tabs or the window's "x" button IE9 is not modal to the dialog. I have tried various forms of modality and none seem to make the entire window and dialog modal. I tried using a window listener in the applet, but it doesn't seem to get the closing message. If you close the windows this way, the java process does not properly shut down and you have to kill it via the task manager. I don't remember this happening with IE8. Is there any way to make the entire IE9 window and my dialog modal?
Asked
Active
Viewed 459 times
4
-
3Why not launch the applet free floating using [Java Web Start](http://stackoverflow.com/tags/java-web-start/info)? – Andrew Thompson Nov 20 '12 at 13:40
-
you can use javascript to monitor the closing event, and remind the user not to close it. – Hai Bi Jan 02 '13 at 02:18
-
I don't think it's possible (using Java). The browser is a separate container from you and can, pretty much, do as it likes. The modal state is maintained by the applet and does not extended to the container or plugin. Andrew's suggestion is probably the best choice you're going to get. – MadProgrammer Jan 24 '13 at 23:29
1 Answers
0
Prior to raising the java modal, could you communicate back out to the page via liveconnect javascript call, setting a function to window.onclose that either sets focus back on the applet or prompts the user via browser confirm or alert?
Upon closing/dismissal of the applet dialog, you could clear the browser window.onclose function pointer.
Hope this helps,
-Scott H

Scott Heaberlin
- 3,364
- 1
- 23
- 22