File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modal dialog problem with JApplet

 
tahelu kumar
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

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.
like the usual modal dialogs which can be made using javascript.
Is there any way to make a JDialog modal with respect to browser.

Any hints or answer would help me a lot.
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
tahelu kumar
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
tahelu kumar
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to make this dialog modal for the current tab and for the whole browser(if possible).
 
tahelu kumar
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can anyone help me here please?
 
tahelu kumar
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can anyone help me here please?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you want to control how I use my browser?

that's an awful idea, and, by the lack of responses, I'd say I'm not alone in my opinion.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic