Minor fix : use WindowConstants.EXIT_ON_CLOSE instead of JFrame.EXIT_ON_CLOSE