title: How to add Screen Saver to my javafx application?
body: <p>I am creating javafx application and i want to put screen saver functionality to my application.</p>
  
  <p>If user become inactive for a period of time ( like 1 min ) and did not do any mouse event , i want to add another pane with image on top of it.</p>
  
  <p>when user generates mouse click, screensaver screen should be removed and previous screen should be visible.</p>
  
  <p>Any one can guide me how to do it ?</p>
  
  <p>I know it can be done by generating a new thread but every time a mouse event occurs , i cant add new thread everytime.</p>
  
  <p>public void start(Stage primaryStage) throws Exception{</p>
  
  <pre><code>    Parent root = FXMLLoader.load(getClass().getResource("/fxmls/Main.fxml"));
      Scene scene = new Scene(root,800,480);
      scene.addEventFilter(MouseEvent.MOUSE_RELEASED, (EventHandler&lt;MouseEvent&gt;) event -&gt; {
          EventTarget comp = event.getTarget();
  
          System.out.println("Event Occured :- " + comp.toString());
      });
      primaryStage.setScene(scene);
      primaryStage.setTitle("Test");
      primaryStage.show();
  
  
  }
  </code></pre>
  
  <p>this is i have done so far, i put listener to every mouse click occurred on scene.</p>