Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call a method when closing JFrame

843807May 30 2008 — edited Jun 5 2008
Hey, I want to call a method when closing a JFrame when using the close on the titlebar.

Normally I would use...
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

However I want to call a few methods to tidy up before closing. Can anyone suggest a method/some code for doing this?

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 3 2008
Added on May 30 2008
2 comments
416 views