title: No exit option if something is running
body: <p>How can I catch something going on if the user chooses the exit option from a menu?
  I mean I'd like to be able to manage the event of a user who is going to close the application
  but some activity is being performed so he/she shouldn't be able to exit.</p>
  
  <p>Here's the code I wrote.
  In a nutshell :</p>
  
  <ul>
  <li><p>recording is being performed --> user clicks exit --> WARNING "Process is running you can't do it"(The process goes on)</p></li>
  <li><p>nothing is running --> user clicks exit --> application closes</p></li>
  </ul>
  
  <p>Is it possible to solve the problem by just adding a few lines of code without having to rewrite the 
  entire program?</p>
  
  <p>thanks very much in advance.<br>
  MAX </p>
  
  <pre><code>exitAction = new AbstractAction("Exit") {
  
              public void actionPerformed(ActionEvent e) {
  
                  System.exit(0);
              }
          };
          exitAction.putValue(Action.NAME, "Exit");
          // description 
          exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit application");
  </code></pre>