awt - Java getting mouse location -


this got far, printing mouse position every 1000ms, how can code such when click on position print out location

  public static void main(string[] args) throws interruptedexception {           while (true) {              thread.sleep(1000);             system.out.println("(" + mouseinfo.getpointerinfo().getlocation().x + ", " + mouseinfo.getpointerinfo().getlocation().y + ")");         }        } 

use mouselistener's java swing. mouse position.

http://www.realapplets.com/tutorial/mouseclickexample.html

http://docs.oracle.com/javase/7/docs/api/java/awt/event/mouseevent.html


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -