This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes problem with closing JDialog created with JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem with closing JDialog created with JFrame" Watch "problem with closing JDialog created with JFrame" New topic
Author

problem with closing JDialog created with JFrame

dave sheffield
Greenhorn

Joined: Sep 26, 2003
Posts: 1
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 !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with closing JDialog created with JFrame