title: How can I delay the time between two method calls?
body: <p>i am writing a program where i shutdown the system after a message box has been shown containing this text, "You have 60 seconds until system shutdown", </p>
  
  <p>but i want to wait 60 seconds after this box shows to run the run time, after hours of research i  cant figure out how to do this, nor can my AP-Programming teacher...</p>
  
  <p>Can anyone help me please?</p>
  
  <p>I'm doing this in a GUI so i think in need a swing timer, but I'm not sure.</p>
  
  <p>this is what i have-</p>
  
  <pre><code>    private void Shutdown() throws IOException {
      Runtime runtime = Runtime.getRuntime();
      JOptionPane.showMessageDialog(null, "You have 60 seconds until system shutdown");
       timer = new Timer(60,);
      Process proc = runtime.exec("shutdown -s -t 60");
  }
  
  private void Logoff() throws IOException {
      Runtime runtime = Runtime.getRuntime();
      JOptionPane.showMessageDialog(null, "you have 60 seconds until system logoff");
      timer = new Timer(60, )
      Process proc = runtime.exec("shutdown -l -t 60");
  </code></pre>
  
  <p>i am calling these methods from my button click</p>