This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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 !
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: problem with closing JDialog created with JFrame
 
Similar Threads
fix JDialog position relative to its parent JFrame component
JDialog With Icon
Dialogs lose focus when minimizing and restoring the application
JDialog Question
Calling JDialog from JDialog - Urgent please...