title: Java MouseClick Listener not working
body: <p>So I'm working on a deal or no deal java game essentially, and right now I'm trying to have the image icon disappear where the user clicked. So I have an 6 by 6 array of 'metal briefcase' (casesArray) image icons, but regardless of where the user clicks, only the image icon in the top left disappears. I'm guessing this is just a logic mistake on my part, but I can't seem to figure out what I'm doing wrong...</p>
  
  <pre><code>class MouseClickListener implements MouseListener
      {
          public void mouseClicked (MouseEvent event)
          {
              if (event.getX() &lt;= 133)row=0;
              else if (event.getX() &lt;= 267 &amp;&amp; event.getX()&gt;133)row=1;
              else if (event.getX() &lt;= 400 &amp;&amp; event.getX()&gt;267)row=2;
              else if (event.getX() &lt;= 533 &amp;&amp; event.getX()&gt;400)row=3;
              else if (event.getX() &lt;= 667 &amp;&amp; event.getX()&gt;533)row=4;
              else if (event.getX() &lt;= 800 &amp;&amp; event.getX()&gt;667)row=5;
               if (event.getY() &lt;= 100)column=0;
              else if (event.getY() &lt;= 200 &amp;&amp; event.getY() &gt; 100)column=1;
              else if (event.getY() &lt;= 300 &amp;&amp; event.getY() &gt; 200)column=2;
              else if (event.getY() &lt;= 400 &amp;&amp; event.getY() &gt; 300)column=3;
              else if (event.getY() &lt;= 500 &amp;&amp; event.getY() &gt; 400)column=4;
              else if (event.getY() &lt;= 600 &amp;&amp; event.getY() &gt; 500)column=5;
  
              casesArray[row][column].setIcon(null);
              repaint();
          }
      .
      .
      .
      .
  for(int i=0; i&lt;6; i++)
      {
          for(int j=0; j&lt;6; j++)
          {
              casesArray[i][j].addMouseListener(new MouseClickListener());
          }
      }
  </code></pre>