Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Making a dialog modal to an applet

Posted on 2001-06-05
4
Medium Priority
?
499 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 80 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

Independent Software Vendors: 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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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 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:
Suggested Courses

773 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