java - in the mouse click method when i call the method get X() and get Y() it return -8 regardless the position -


public void mouseclicked(mouseevent e) {         system.out.println("mouse click working");         system.out.println(getx());         system.out.println(gety());      } 

you're calling getx() , gety() on containing class, not on mouseevent.

e.g. need

e.getx(); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -