Solved

ModalDialog and applets

Posted on 1998-07-08
1
187 Views
Last Modified: 2010-03-30
I need to have a modal dialog popup on top of the aplet that is running in a browser.  When the user makes an error, I need to tell them about it, but the only ModalDialog I can find requires a Frame object to be passed in to the constructor.  The othere option was to use my own dialog, but it would get lost behind the browser because I could not make it Modal.
How do I get a modal dialog to popo up on top of an applet.
Thanks,
Georg
0
Comment
Question by:georita
1 Comment
 
LVL 5

Accepted Solution

by:
msmolyak earned 50 total points
ID: 1225397
Two ways to do it.  If you search up the hierarchy starting with your applet, you will find a frame:

Container cont = getParent();
while (!(cont == null))
{
  if (cont instanceof Frame)
  {
    break;
  }
  cont = cont.getParent();
}

Or you can fake it: create a new Frame and pass it to the dialog's constructor:

super (new Frame(), "My Dialog, true);
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

808 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