vendredi 30 mai 2014

How to know mouse has been clicked


Vote count:

0




i can get the pointer position using this program



import java.awt.MouseInfo;
import java.awt.GridLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
import javax.swing.*;
public class mice {
public static void main(String[] args) throws InterruptedException{
while(true){
System.out.println("("+MouseInfo.getPointerInfo().getLocation().x+", "+MouseInfo.getPointerInfo().getLocation().y+")");

}
}
}


Now i want to know is mouse clicked somewhere on my screen??? I do not want to know inside my screen.It should be on natural screen.can we use USBMON for this? or is their some other way...



asked 52 secs ago






Aucun commentaire:

Enregistrer un commentaire