{
// Create and set up the window.
JFrame frame = new JFrame("MouseEventDemo (C to clear)");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
// Create and set up the content pane.
JComponent newContentPane = new MouseEventDemo();