title: Get latitude longitude from a jxmapviewer2
body: <p>I'm displaying an OSM map with the library <a href="https://github.com/msteiger/jxmapviewer2" rel="nofollow noreferrer">jxmapviewer2</a>.</p>
  
  <p>I cannot manage to get the lat lon of a point of the map, for istance I would like to get the geographic coordinates of a spot by clicking it</p>
  
  <pre><code>public void mouseClicked(MouseEvent e) {
    if(e.getClickCount() == 1 &amp;&amp; e.getButton() == MouseEvent.BUTTON3){
      java.awt.Point p = e.getPoint();
      double X = p.getX();
      double Y = p.getY();
      System.out.println("X:"+X+",Y:"+Y);
    }
  }
  </code></pre>
  
  <p>This code above returns an output like: </p>
  
  <pre><code>X:239.0,Y:113.0
  </code></pre>