• Post Reply Bookmark Topic Watch Topic
  • New Topic

Closing a frame

 
Jyothsna Sri Y
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I'm creating a frame on the fly from another frame. I need to close it on hitting the submit button. At all other times till the submit button id displayed and hit, it has to remain open. So I have mentioned :
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
i'm not able to change this option in the actionperformed methos for the submit button.
The frame invoking this frame should not close. So i cannot use System.exit. It has to remain running in the background.
Can someone give me a solution?
Thanks
Regards
Jyothsna.
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should try using SwingConstants.DISPOSE_ON_CLOSE
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!