13. This line adds a window listener so that the application ends when the frame closes.