Is there any difference between the two. I was reading an article ( http://www.javalobby.org/java/forums/t17933 ) about that you should always use
System.exit(0);
Currently I use
JFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
The article says that even for a Java Swing Application you should add a listener WindowAdapter
and and call System.exit()
inside its method windowClosing(WindowEvent e)
.
Is there any difference? Is one method better then the other?