Solved

ModalDialog and applets

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoresSpecial  challenge 13 40
array220 challenge 8 45
GUI builder for Eclipse? 8 8
Java DateChooser? 2 5
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

708 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

17 Experts available now in Live!

Get 1:1 Help Now