mainGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Intellij Code Analysis:
Warning:(33, 46) Must be one of: WindowConstants.DO_NOTHING_ON_CLOSE, WindowConstants.HIDE_ON_CLOSE, WindowConstants.DISPOSE_ON_CLOSE, WindowConstants.EXIT_ON_CLOSE
SO,is it better to use WindowConstants.EXIT_ON_CLOSE
rather than JFrame.EXIT_ON_CLOSE
?
Why?