title: Simple memory game with replay button
body: <p>I want to build a simple memory game. I want to put a replay button, which is play again the memory game.</p>
  
  <p>I have built a class named <code>MemoryGame</code> and a main class.</p>
  
  <p>Here is the part of the <code>ButtonListener</code> code. </p>
  
  <pre><code>public void actionPerformed(ActionEvent e) {
          if (exitButton == e.getSource()) {
              System.exit(0);
          }
          else if (replayButton == e.getSource()) {
              //How can I declare it? 
          }
  }
  </code></pre>
  
  <p>If I declare the replay button as : </p>
  
  <pre><code>new MemoryGame();
  </code></pre>
  
  <p>It's work fine, but it pops up another windows.</p>
  
  <p>I want to clear the current display and return to the beginning, without a new windows. How can I do that?</p>
  
  <p>EDIT : </p>
  
  <p>I think I need to rewrite the code of my program, because my program does not have the <code>init()</code> method as suggested which is the initial state of the program.</p>
  
  <p>My Java knowledge is very limited and usually I create less method and dump most into a method.</p>
  
  <p>I will try to redo my program.</p>
  
  <p>Thanks for the suggestions.</p>