The importance, fundamental principles and methods of tuning optical cavity for free-electron lases are described. An adjustable mechanical device controlled by a microcomputer is used for adjusting with a fine resolution., and an electro-strictive device iontrolled by the same microcomputer is used for adjusting with superfine resolution. The fine adjusting range is 6cm, and the resolution is better than 0.5μm. The superfine adjusting range is 10μm, and the resolution is better than 0.1μm.