Google Search
From this I found a simple definition of the close function. Here it is.
I want to close my JFrame either by the user clicking on the "X" or when the user clicks on the "Save" button.
The simplest way to do this is to add one of the four to your JFrame code:
this.setDefaultCloseOperation ( JFrame.DISPOSE_ON_CLOSE );
this.setDefaultCloseOperation ( JFrame.HIDE_ON_CLOSE );
this.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
this.setDefaultCloseOperation ( JFrame.DO_NOTHING_ON_CLOSE );