Hi, If you see the JDialog constructor API, these constructors will allow either a Frame or a Dialog as owners (owner from which the dialog is displayed --- See the constructors for more info about the use of owner.). But in my case, I have to show/popup this JDialog from a JPanel. I want a modal dialog (don�t want a non-modal dialog) and I don�t have either a Frame or a Dialog as owner (but only have JPanel). how to achieve a modal dialog?
Yeah, um do the whole ancestor thing. The dialog just wants to know what window/frame/whatever is it's parent so if the parent is closed, the JVM can take care of destroying all of it's child windows too. Heck, you could probably just pass a null value to the constructor and everything will be hunky-dory if it's modal and you don't have other threads floating around out there to complicate things for you.