title: How to create a dialogbox that will pop up after 5 minutes of idleness by the user? (java)
body: <p>I have a dialog box that is:</p>
  
  <pre><code>JOptionPane.showMessageDialog(null,"Once medicine is given, measure temperature within 5 minutes." ,"Medication" ,JOptionPane.PLAIN_MESSAGE); 
  </code></pre>
  
  <p>When the user presses 'ok', it goes straight to a Jframe that ask the user to input the temperature using a slider and then pressing a button that takes it to the next set of things. </p>
  
  <p>Anyways, I want to create somekind of inivisble countdown after the user presses 'ok', so after 5 minutes of idleness on the Jframe menu, one warning dialog box should appear on top of the JFrame and says something like "NEED ATTENTION".</p>
  
  <p>This reminds me of actionListener. but it will be invoked by non-physical element, 5 minutes, (not by any click of button). </p>
  
  <p>So Maybe the code should be like:</p>
  
  <pre><code>JOptionPane.showMessageDialog(null,"Once medicine is given, measure temperature within 5 minutes." ,"Medication" ,JOptionPane.PLAIN_MESSAGE); 
  
  
  temperature_class temp = new temperature_class(); // going to a different class where the the Jframe is coded
  
      if (time exceeds 5 minutes) { JOptionPane.showMessageDialog(null, "NEED attention", JOptionPane.WARNING_MESSAGE);}
      else { (do nothing) }
  </code></pre>
  
  <hr>
  
  <p>Code works:</p>
  
  <pre><code>JOptionPane.showMessageDialog(null,"measure temp" ,"1" ,JOptionPane.PLAIN_MESSAGE); 
  
  int delay = 3000; //milliseconds
   ActionListener taskPerformer = new ActionListener() {
   public void actionPerformed(ActionEvent evt) {
  
  JOptionPane.showMessageDialog(null,"hurry." ,"Bolus Therapy Protocol" ,JOptionPane.PLAIN_MESSAGE); } };
  new Timer(delay, taskPerformer).start();
  
  temperature_class temp = new temperature_class();
  </code></pre>
  
  <p>However, I want it do it only once. So how do I invoke set.Repeats(false)? </p>