jframe.exit_on_close code example Example: jframe exit on close frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);