How do I invoke extra operations when the user closes a JFrame window? I have to stop existing threads.
JFrame
As I understand it, setDefaultCloseOperation(J
setDefaultCloseOperation(J
You can set the default close operation on the JFrame
JFrame frame = new JFrame("My Frame"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);