title: Hovering over JButtons and displaying a message
body: <p>I want to hover over a number of JButtons on my GUI (map) and display the name of that location e.g. Manchester and London. I have the code working for one button, but it does not work for more than one button and prints the last <code>out</code> message (as i have 10 buttons) for all button locations.</p>
  
  <p>If <code>button1</code> is true it then draws the text on the GUI in the specified area via my <code>paintComponent()</code> method.</p>
  
  <p>How can i resolve this?</p>
  
  <pre><code>button1.addMouseMotionListener(this);
  button2.addMouseMotionListener(this);
  </code></pre>
  
  
  
  <pre><code>public void mouseMoved(MouseEvent arg0)
  {
      if(button1.contains(arg0.getPoint()))
      {
          button1  = true;
          out = "test 1";
          repaint();
      }
  
      if(!button1.contains(arg0.getPoint()))
      {
          b1 = false;
          out = " ";
          repaint();
      }//same for all 10 buttons but change variables
  }
  </code></pre>