import java.awt.geom.AffineTransform; // ... // transform that shifts points 10 right and 20 up AffineTransform transformer = AffineTransform.getTranslateInstance ( 10.0d, -20.0d ); // create transform to undo the translation. AffineTransform reverse = transformer.createInverse(); // manually untransform points as above with reverse.transform( before, after ), Point mousePositionUC = new Point(); reverse.transform( new Point( mousex, mousey ), mousePositionUC );