title: Java Timer does not wait previous TimerTask to be finished before the new one is started
body: <p>I am writing an app in Java and I am stuck in the following: After an amount of time, a inputDialog(JOptionPane) is shown. Because the intervals are short, ie 10 secs, if I delay interacting with the first dialog, then the second will appear immediately after I will. Is there any way to avoid this? I thought that program would wait for my input. </p>
  
  <p>Code: </p>
  
  <pre><code>Timer timer = new Timer();
      timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
              String task = JOptionPane.showInputDialog(null, "What are you doing now???", "");
            }
          }, 10*1000, 10*1000);
  </code></pre>