[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem with JApplet and Modal JDialog

Posted on 2001-09-05
3
Medium Priority
?
709 Views
Last Modified: 2008-02-01
Hi All,

I have problem with modal dialogs in a JApplet. The dialog
loose focus when I click on the parent applet. Then the dialog disappear behind Internet Explorer.

How to sovle this problem?

Thanks
nhp
0
Comment
Question by:nhphu
[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
3 Comments
 
LVL 9

Expert Comment

by:Ovi
ID: 6456677
You can't, the JDialog event if is modal is not a system modal dialog, but a Java modal dialog. So the flag modal will not work "outside" a Java enviroinment.
0
 
LVL 16

Expert Comment

by:Valeri
ID: 6456913
Put this line in the constructor of your class that extends JDialog :

super(JOptionPane.getFrameForComponent(theparentComponent), "Title", true);

I hope it will help you.
best regards,
Valeri
0
 
LVL 16

Accepted Solution

by:
heyhey_ earned 30 total points
ID: 6457194
you have to use the appropriate parent Frame

try something like this

Frame modalFrame;
Component c = applet;
while ((c != null) && !(c instanceof Frame)) c = c.getParent();

if (c != null)
  modalFrame = (Frame)c;
else
  modalFrame = new Frame("dummy modal");
 
 
JDialog dialog = new JDialog(modalFrame, ...);
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
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 about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

656 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