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
Post a Comment