I am not sure how to handle this one. I have in my connection object, written code that releases all locks when a user exits the gui from the Exit item on my menu( I used the body of the close() method). However my frame uses DefaultCloseOperation and exits without releasing the locks. I don't want to add a WindowListener and implement the same functionality which my controller handles in my view object. Please give me some advice on this one. It is the fact that windowListener creates a WindowAdapter that is confusing. How do we seperate them into MVC pattern?