I know you can,

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

but is there a way to get it to execute a method and then exit?
example..

frame.setDefaultCloseOperation(saveData, JFrame.EXIT_ON_CLOSE);

just a guess?

thanks all

Recommended Answers

All 2 Replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.