Solved

ModalDialog and applets

Posted on 1998-07-08
1
188 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

761 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