title: Auto close Dialog with cancel response after timeout
body: <p>I have implemented javaFX-Dialogs by taking the help of the Oracle Documentation<br>
  <a href="https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Dialog.html" rel="nofollow">https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Dialog.html</a></p>
  
  <p>and the tutorial<br>
  <a href="http://code.makery.ch/blog/javafx-dialogs-official/" rel="nofollow">http://code.makery.ch/blog/javafx-dialogs-official/</a></p>
  
  <p>So far I have done the following things:<br>
  I have added a timeline in the dialog window.</p>
  
  <pre><code>public static void idleness(final DialogTemplate template) {
      System.out.println("timeline Started -" + Calendar.getInstance().getTime());
      Timeline idlestage = new Timeline(new KeyFrame(Duration.seconds(15), new EventHandler&lt;ActionEvent&gt;() {
  
          @Override
          public void handle(ActionEvent event) {
              template.hide();
          }
      }));
      idlestage.setCycleCount(1);
      idlestage.play();
  
  }
  </code></pre>
  
  <p>Now Dialog Window is hiding after 15 sec but not able to get any Dialog response.</p>
  
  <p>Expectation:
   If user doesn't give any response within a given time, then negative response have to be recorded and dialog windows should get closed.</p>