~/ learn/ comp-308/ cards/ GUI Development with Swing
1 of 28

Type the JFrame setup with EXIT_ON_CLOSE

Type the JFrame setup with EXIT_ON_CLOSE

Answer

JFrame frame = new JFrame("Greenhouse Controls"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

The default close operation only HIDES the window; EXIT_ON_CLOSE ends the JVM so closing the panel actually quits the program.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/61155635-6595-4905-a14e-b83eff83d95a/flashcard utf-8 LF