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.