title: why my code does not find if the images that i select are same or not?
body: <p>I want to select three images at once, if they are the same keep them opened 
  and if they are not the same to close back. My code let me open three cards and then closes back the second and third card except of the first one. So the problem is that it does not check if they are the same or different and does not close the first selected card like the others.</p>
  
  <p>This is my code where i check if the three images that i open at the time are same or not.But it does not working.(i am sorry but i do not speak good english...)</p>
  
  <pre><code>  private class ImageButtonListener implements ActionListener{
  
      @Override
      public void actionPerformed(ActionEvent e) {
           if(t.isRunning())
              return;
          openImages++;
          System.out.println(openImages);
          for(int i=0; i&lt;numbuttons;i++){
              if(e.getSource()==buttons[i]){
                  buttons[i].setIcon(icons[i]);
                  first=i;
              }
          }
          if(openImages % 3 == 0){
              if((first != second || first != third) || second!=third){
              } else {
                  numClicks--;
                  return;
               }
              if((!icons[first].equals(icons[second]) &amp;&amp; !icons[first].equals(icons[third])) &amp;&amp; !icons[third].equals( icons[second])){
                  t.start();
              }else{
                  score++;
                  if(score==12){
                           setVisible(false);
                  }
              }
          }else{
              second=first;
          }
      }         
  </code></pre>