title: How to know coordinates of java frame?
body: <p>I am trying to develop a very basic game and it involves mouse. So what i am trying to do is getting coordinates of mouse to write a integer. I searched internet and find this.</p>
  
  <pre><code>mouse_x=MouseInfo.getPointerInfo().getLocation().getX();
  mouse_y=MouseInfo.getPointerInfo().getLocation().getY();
  </code></pre>
  
  <p>It partially worked and gave me coordinates of mouse on desktop. But what i need is coordinates of mouse on frame. So if only i knew the coordinates of frame's starting (0,0) point (not the window's. the white area without toolbars.) I could calculate mouse's coordinates.<br>
  Thanks in advance.<br>
  Or if thats not possible i could use how to develop it in fullscreen.<br>
  And i need to know location of mouse always. It should refresh position when i run it in a never ending while loop.</p>