• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with closing JDialog created with JFrame

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
reply
    Bookmark Topic Watch Topic
  • New Topic