title: Is there a way to stop MouseListener?
body: <p>Okay, so what I'm trying to do is place an image by clicking. I have a boolean and I have it set so that it's true when the mouse is being pressed, and false when it's released. Then I have the following codes:</p>
  
  <pre><code>if (place == true){
                  msex = MouseInfo.getPointerInfo().getLocation().x;
                  msey = MouseInfo.getPointerInfo().getLocation().y;
              }
  </code></pre>
  
  <p>and this on the main screen so it shows up:</p>
  
  <pre><code>if (place == true){
              d.drawImage(twilightblock,msex - 45,msey - 85,this);
          }
  </code></pre>
  
  <p>However, when I try it, I click and it shows up, but it disappears when I release the mouse button. It also moves around with the mouse instead of staying in one place. I'm wondering, is there a way to stop MouseListener in the middle, like, right after the button is pressed? If so, that would be perfect. :D</p>