Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

window closing?

 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
When I close the window by clicking the X at right-top corner, the window closes even I don't add a window listener,why?
Damu
 
Rick Lu
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When I close the window by clicking the X at right-top corner, the window closes even I don't add a window listener,why?

You need to check the method "public void setDefaultCloseOperation(int operation)" in JDialog. That will help.
Rick
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To expand on what Rick said, here is more documentation on the window closing events.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic