title: javax.swing.Timer vs java.util.Timer inside of a Swing application
body: <p>is this better to use <code>javax.swing.Timer</code> inside of a swing application instead of using <code>java.util.Timer</code>?</p>
  
  <p>for example:</p>
  
  <pre><code>Timer timer = new Timer(1000, e -&gt; label.setText(new Date().toString()));
      timer.setCoalesce(true);
      timer.setRepeats(true);
      timer.setInitialDelay(0);
      timer.start();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>new java.util.Timer().scheduleAtFixedRate(new TimerTask() {
          @Override
          public void run() {
              label.setText(new Date().toString());
          }
      }, 0, 1000);
  </code></pre>
  
  <p>is there any difference between this two?</p>