title: How to get this project to pause for the given amount of time after the button is pressed
body: <p>So, I am trying to figure out how to add pauses in my card game to make the CPU act like they are taking turns. But, there's too much code involved, so I think if we demonstrate the strategy on this code, it could work.</p>
  
  <p>How can I make this code pause for, say 5 seconds after the button has been pushed and THEN print the message.</p>
  
  <pre><code>public class TimerTest extends JFrame implements ActionListener{
  
  private static final long serialVersionUID = 7416567620110237028L;
  JTextArea area;
  Timer timer;
  int count; // Counts the number of sendings done by the timer
  boolean running; // Indicates if the timer is started (true) or stopped (false)
  
  public TimerTest() {
      super("Test");
      setBounds(30,30,500,500);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      setLayout(null);
  
      area = new JTextArea();
      area.setBounds(0, 0, 500, 400);
      add(area);
  
      JButton button = new JButton("Click Me!");
      button.addActionListener(this);
      button.setBounds(200, 400, 100, 40);
      add(button);
  
      // Initialization of the timer. 1 second delay and this class as ActionListener
      timer = new Timer(5000, this);
      timer.setRepeats(true); // Send events until someone stops it
      count = 0; // in the beginning, 0 events sended by timer
      running = false;
      System.out.println(timer.isRepeats());
      setVisible(true); // Shows the frame
  }
  
  public void actionPerformed(ActionEvent e) {
      if (! running) {
          timer.start();
          running = true;
      }
      // Writing the current time and increasing the cont times
      area.append(Calendar.getInstance().getTime().toString()+"\n");
      count++;
      if (count == 10) {
          timer.stop();
          count = 0;
          running = false;
      }
  }
  
  public static void main(String[] args) {
      // Executing the frame with its Timer
      new TimerTest();
  }
  }
  </code></pre>
  
  <p>What I really would like to do is to be able to insert a pause into my method that runs the actions of each CPU. But it sounds like, with the Timer class, you need to perform your post-pause actions in the Timer's action listener. I am mostly confused about why the Timer needs an actionListener. I don't need the timer to repeat itself after it is done.</p>
  
  <p>If it would be better for me to post my own code, let me know. But I am not sure what parts would be useful, since I don't want to have tons of code in this thread.</p>