title: How to use tooltips on rectangle created by mouse movement - Java
body: <p>I am creating a rectangle with my mouse and i'm just trying to return info from the created object with a mouseover. I've been solving this with a messabox but there's just not many country to mouseover so the number of popup can be monstrous.</p>
  <p>I decided to use a tooltip. Thing is it's not working on my mouse over :</p>
  <pre><code>       JTextField text = new JTextField();
      if (coordX &gt; coordXRec &amp;&amp; coordX &lt; coordXRec + width &amp;&amp; coordY &gt; coordYrec &amp;&amp; coordY &lt; coordYrec + height){
          text.setToolTipText(i.GetInfoPays());
          text.getToolTipText();
  }
  </code></pre>
  <p>Naturally, i want it to show when i mouseover my rectangle created :</p>
  <p><a href="https://i.stack.imgur.com/PGwm8.png" rel="nofollow noreferrer">That green rectangle was made by the user so i can't 'preset' an event
  or use it as a panel for my tooltip.</a></p>
  <p><a href="https://i.stack.imgur.com/z5WuQ.png" rel="nofollow noreferrer">This is what excepted, but using a tooltiptext, not a messabox.</a></p>
  <p>I've been using a MouseEventMoved to know if im hovering over my rectangle. Its working but i'm stuck at sort of changing my messagebox into a tooltip.</p>