Just save the variable with the previous JFrame location so open, and for the following:
newFrame.setLocation(previousLocation.x + constant, previoudLocation.y + constant);
getLocation() will return you the location on the screen of an existing JFrame .
source share