Problem adding close operation to a JButton. Java
<p>I'm having some trouble figuring out how to make a JButton prompt the user to save the contents in a JTextArea before closing the program. So far, I have some code for the close operation for my button, but even that doesn't seem to work... nothing happens when I click it:</p>

<pre><code>public void actionPerformed(ActionEvent event) {

  if(event.getSource() == this.Quit)
        this.dispose();
....
</code></pre>

<p>the rest are more else/if/try statements for other buttons.</p>

<p>I set my class to extend JFrame and implement ActionListener, so my entire program is in one class... probably not a very neat way to code, but I'm finding it easier to stick everything here for now before I distribute some functions into other classes.</p>

<p>Basically, nothing happens, and I don't know how to add the save prompt along with closing it afterwards. Any help would be great!</p>
