Solved

Making a dialog modal to an applet

Posted on 2001-06-05
4
481 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
[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
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 20 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

Industry Leaders: 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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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.
Suggested Courses

752 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