Solved

Making a dialog modal to an applet

Posted on 2001-06-05
4
488 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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