Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java mouselistener get coordinates

implement MouseListener

@Override
public void mouseClicked(MouseEvent e) {
    int x=e.getX();
    int y=e.getY();
    System.out.println(x+","+y);//these co-ords are relative to the component
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #mouselistener #coordinates
ADD COMMENT
Topic
Name
2+1 =