A projector for automatically adjusting images projected onto a screen includes a detecting module for detecting a propagation time for projected ultrasonic waves sent by the projector to be echoed back by the screen and received by the projector, a processing module for calculating a projection distance between the projector and the screen based on the propagation time, and outputting a focal length signal corresponding to the projection distance, an optical module, and an adjusting module for adjusting a local length of the optical module according to the focal length signal. A related method is also provided.