• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Modal dialog problem with JApplet

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22819
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, can anyone help me here please?
 
tahelu kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, can anyone help me here please?
 
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic