Solved

ModalDialog and applets

Posted on 1998-07-08
1
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

628 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