I was working through an example program that called System.exit(). I commented it out. Assuming you are not running a complicated multi-threaded program, when the program goes out the bottom of main(), the JVM will take care of the shut down sequence.
A java program terminates when there is no more non-daemon thread running. The AWT event handling thread is a non-daemon thread, so you either have to stop it (though I don't recall how to do that) or to call System.exit().
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
in an applet you don't need to call System.exit(o) because the program terminates when you shut down the applet. but an application doesn't do so... if you closes the window press the 3-fingered salute (ctrl+alt+del) and you will see a java application still running. it'll cost your ram. so call System.exit(0) use the windowsadapter so when you close the window it also shuts down the program