title: Stoping a Swing Timer within the actionPerformed Method?
body: <p>How would I stop a Swing timer within it's actionPerformed method?
  I am able to start and stop the timer outside the actionPerformed method but not with in the method how would I accomplish this?</p>
  
  <pre><code>final int i =0;
      final Timer timer = new Timer(10, new ActionListener() {
          int i = 0;
          public void actionPerformed(ActionEvent evt) {
              i++;
              System.out.println(i);
              if(i == 100) {
                  timer.stop();
              }
  
  
          }    
      });
      timer.start();
  </code></pre>