~/ learn/ comp-308/ cards/ Swing components & containers
1 of 7

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/4921f4ce-0cf6-45be-82ed-9433d4ccdf22/flashcard utf-8 LF