~/ 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/e7932c93-b1e8-4e8f-8704-ad687296b92b/flashcard utf-8 LF