Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java get mouse coordinates

int x =  MouseInfo.getPointerInfo().getLocation().x;
int y = MouseInfo.getPointerInfo().getLocation().y;
Comment

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
}
Comment

PREVIOUS NEXT
Code Example
Java :: react native webview debug network 
Java :: java number of days between dates 
Java :: change date jdatepicker java 
Java :: java get specific element from arraylist 
Java :: bouble to bytes[] java 
Java :: java string to char array 
Java :: java joptionpane input 
Java :: java replace all space with underscore 
Java :: decimal format 
Java :: plus one leetcode 
Java :: dialog box in java swing 
Java :: How to find a target value within a binary search tree, in Java? 
Java :: Could not identify launch activity: Default Activity not found 
Java :: how to download pdf file from firebase storage and save in external private storage in android 
Java :: android volley 
Java :: android action key 
Java :: get all number from string java 
Java :: java all alphabet characters 
Java :: install java 11 jdk raspberry pi 
Java :: print hashtable in java 
Java :: java trim method 
Java :: localdate to date java 
Java :: how to change top of window in java 
Java :: jframe button 
Java :: java pause program until key pressed 
Java :: how to declare list of object in java as constant 
Java :: java load .json file 
Java :: android glide 
Java :: simple java program 
Java :: calculate mean from arraylist jaca 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =