Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getX and getY does not return accurate results

KHootMar 2 2011 — edited Mar 22 2011
I have a tree view and it has been working for a few years. The sample code is:

@Override
public void mouseMoved(MouseEvent e) {
//System.out.println("mouse Moved");
mouseX = e.getX();
mouseY = e.getY();
}

I use the coordinates for a mouse click later to determine where the mouse is located within the applet. Recently, I have had 3 computers that do not return the correct xy for the mouse location. It seems to be about -15 to -20 off from the mouse.

Any suggestions for this type of behavior? 2 users are on laptops and one is on a desktop with a large monitor.

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2011
Added on Mar 2 2011
4 comments
225 views