Why doesn't this Swing-based program terminate when its window is closed?
import javax.swing.JFrame;
import javax.swing.JOptionPane;
final class App extends JFrame {
private App() {
super("App");
setDefaultCloseOperation(EXIT_ON_CLOSE);
JOptionPane.showMessageDialog(this, "App works");
pack();
}
public static void main(final String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
new App().setVisible(true);
}
});
}
}