Forums Register Login

problem with closing JDialog created with JFrame

+Pie Number of slices to send: Send
Hello !
Please help me to solve the following problem:
I create the class (extended from JDialog) from other class (extended from JFrame).
class dialog extends JDialog implements ActionListener{
.............
public dialog(frame fr){super(frame,"Dialog window",true);}
.............
protected void actionPerformed(ActionEvent ev){
JButton b=(JButton)ev.getSource();
if(b==nobutton){setVisible(false);dispose();}
//this code closes the parent window !!!
}
}
class frame extends JFrame{
}
I can't understand why the parent frame hides automaticaly when i close or hide the modal dialog.
Thank you very much !
machines help you to do more, but experience less. Experience this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 915 times.
Similar Threads
JDialog With Icon
Calling JDialog from JDialog - Urgent please...
fix JDialog position relative to its parent JFrame component
Dialogs lose focus when minimizing and restoring the application
JDialog Question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:33:31.