title: How to use Timer isRunning?
body: <p>I am creating a program that is creating gates(AND, OR etc.), but when I want to create an SR latch, I need to use a timer. </p>
  
  <p>So when this method(inputChanged) is called it should check if the timer is running. If it is running it should do nothing.  (This is were I am stuck...)
  Otherwise it should check if the new value deviates from the old value(<code>getOutputValue()</code>).</p>
  
  <p>If it does it should save the new value and send an interrupt signal after a small delay. I am using setInitialDelay() for the initial delay but I don't know how to send an interrupt signal.</p>
  
  <p>I wonder what I've done wrong in this code, because it is not working too well....</p>
  
  <pre><code>public void inputChanged()
  {
     timer = new javax.swing.Timer(delay, new ActionListener()
     {
         public void actionPerformed(ActionEvent event) 
          {
              // Check if timer is running.
             if(timer.isRunning())
             {
                 boolean value = calculateValue(); 
  
                 //  new Value            old Value
                 if(calculateValue() != getOutputValue())
                 {
                     timer.setInitialDelay(delay);
                     timer.stop();
                 }
                 outputChanged(value);
             }
          }   
      });
      timer.start();
  }
  </code></pre>