When i make a JDialog modal, it only gets modal with respect to my JApplet only, but i want to make it modal with respect to browser.
Is there any way to make a JDialog modal with respect to browser.
I've checked a bit, and Internet Explorer 9 and Google Chrome only make dialogs modal for the current tab. Other tabs will not be blocked by a modal dialog. I think the reason is that, at least with Google Chrome, each tab has its own process. I think IE9 uses the same technique. You can't work around that. Firefox only has one process and therefore will have the dialog modal for the entire browser (tested with Firefox 8).
You will need to get a reference to the applet's parent window. Unlike with desktop applications, you don't create it. Instead, the browser or Java plugin creates one for you. You can get a reference to it like this:
All my tests have shown that this Window is always a Frame sub class, so you can use that too:
Thanks for the reply Rob, but doing the things as you said did not work for me.
Here is my code:
and i am running the applet in browser by SampleApplet.html file, here is its code:
I place the html file and jar in same folder and run it.
What happening is even at the Firefox 8.0, the dialog is modal only with respect to my applet , not with respect to the tab and not also with browser.
posted 8 years ago
i want to make this dialog modal for the current tab and for the whole browser(if possible).