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
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
To execute custom code of your own on JFrame closing use a WindowListener.
http://download.oracle.com/javase/tutorial/uiswing/events/windowlistener.html
Thanks for the help :)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.