• Post Reply Bookmark Topic Watch Topic
  • New Topic

DialogBox is gone after setModal

 
tee ming
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i had setModal at a JDialog at top of a Frame. But everytime when i open others program and back to maximise the frame of that Java program, the JDialog box will be gone. Only after i click the Alt+Tab key, the JDialog will pop up back. Otherwise only the JFrame will show but can't even close. Can somebody know why ?
 
Jonathan Whitehead
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember having the same problem a while ago, and I think the problem went away after making sure that the "owner" parameter of the constructor correctly referred to the parent dialog or frame. It's usually enough to use "this" in the constructor call (but this depends on what the class of the caller is):
new JDialog(this, "My dialog", true);
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"teeming"
your name is not in accordance with the javaranch guidelines.
Please take a moment and re-register after selecting a valid
name. you can find the guidelines at http://www.javaranch.com/name.jsp
thanks for your cooperation.
- satya
 
abid ghani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that doesn't solve the problem, the jDialog still vanishes from sight until you use alt+tab or minimise every other application.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this from an Applet?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your dialog is truly modal from the frame you are launching it from, you should not be able to maximise the frame while the dialog box is showing...

Oops... I think I've already answered this question... you're really trying to launch from a JApplet... answered it here.

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!