title: Programming Menu for Game, Mouse detection method not working
body: <p>Here is the code for my method that is supposed to detect whether or not a mouse click is within a rectangle that I defined.</p>
  
  <pre><code> private boolean mouseOver(int mx,int my,int x, int y, int width, int height){
  
  
  
      if((x &lt; mx  &amp;&amp; mx &lt; x + width)&amp;&amp;(y &lt; my &amp;&amp; my &lt; y + height)){
          System.out.print(mx+"\n"+my+"\n"+x+"\n"+y+"\n"+width+"\n"+height+"\n");
      return true;
  
      }else 
         System.out.print(mx+"\n"+my+"\n"+x+"\n"+y+"\n"+width+"\n"+height+"\n");
          return false;
  
  
  }
  </code></pre>
  
  <p>This is where I am defining the rectangles (with text).</p>
  
  <pre><code>public void render(Graphics g){
      Font fnt = new Font("arial", 1, 50);
      Font fnt1 = new Font("arial", 1, 30);
      g.setColor(Color.white);
  
      g.setFont(fnt);
      g.drawString("Menu", 240,70);
      g.setFont(fnt1);
      g.drawString("Play", 270,190);
      g.drawRect(210, 150, 200, 64);
      g.drawString("Scores", 270,290);
      g.drawRect(210, 250, 200, 64);
      g.drawString("Quit", 270,390);
      g.drawRect(210, 350, 200, 64);
  }
  </code></pre>
  
  <p>Here is where the method is used.</p>
  
  <pre><code>public void mousePressed(MouseEvent e){
      int mx = e.getY();
      int my = e.getX();
      //play button
      if (mouseOver(mx ,my ,210, 150, 200, 64)){
          game.gameState = STATE.Game;
      }
      //quit button
      if (mouseOver(mx ,my ,210, 350, 200, 64)){
  
          System.exit(1);
  
      }
  }
  </code></pre>
  
  <p>When the method is called I commanded it to spit out the fields it takes, and here is an example. </p>
  
  <p>mx = 185 my = 344 x = 210 y = 350 width = 200 height = 64
  That data was from clicking the mouse inside of the rectangle, so it should have returned true if it was working properly.
  Maybe it's returning the wrong coordinates of the mouse press?</p>
  
  <p>Any ideas? 
  I'm using a mac if that makes any difference. </p>