Exiting:

When the Exit button is pressed, any pending data to be written to the log file is written and the log file is closed. Then System.exit(0); is called. The running threads are terminated by the Java Virtual Machine.