Solved

Making a dialog modal to an applet

Posted on 2001-06-05
4
463 Views
Last Modified: 2006-11-17
Hello,

       I have modal dialog which pops up on click of menu item from an applet. When I start my applet from appletviewer it is fine but when start it from my IE I can till go back to the browser, I know that if user kicks on the same menu again i can make sure that old dialog can be popped up by a simple logic.
        But I would like to know if there is any better way of doing this.

bye,
Sobhan
0
Comment
Question by:sobhan_genie
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 20 total points
ID: 6158501
You need to pass the applet frame to the Dialog ctor.
Try using the following to get the applet frame:

public Frame getAppletFrame()
{
  Container container = applet.getParent();
  while (container != null)
  {
    if (container instanceof Frame)
    {
       return (Frame)container;
    }
  }
  return null;
}

0
 
LVL 3

Expert Comment

by:rkenworthy
ID: 6160598
Actually, this is a defect of IE. No applet dialogs are modal in IE, which really blows. The next best thing, is to design a mechanism such that "clickable" components underneath the dialog are deactivated until the user clicks "ok" (or whatever) in the dialog.

Hope it helps,
Rob
0
 
LVL 92

Expert Comment

by:objects
ID: 6161891
Yes but the above will at least force the dialog window to stay in front of the browser and not get lost behind it.

If you have to stop people interacting with your applet, then just 'cover' it with a glass pane setup to consume all events.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 8898981


No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


--  Points to objects


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now