MyDialog extends JDialog
MyDialog dialog = new MyDialog();
dialog.setModal(true);
dialog.setVisible(true);
In the MyDialog class i have one instance variable XDialog and one more button
click on button i am creating
XDialog is not a modal dialog
XDilog dilaog = new XDilaog();
dilaog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dilaog .addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dilaog .dispose();
}
});
Hi Guys,
i found the solution for this.
If we are creating a dialog from Modal dialog and wants to close the dialog by clicking on "X" created from Model dialog then while creation of the dialog we need to pass the Model dialog instance in the construcor as a owner
like
MyDialog myDialog = new MyDialog(Frame);
XDialog dialog = new XDialog(myDialog);