In this paper, we compute a phase field (diffuse interface) model of Cahn-Hilliard type for moving contact line problems governing the motion of isothermal multiphase incompressible fluids. The generalized Navier boundary condition proposed by Qian et al.  is adopted here. We discretize model equations using a continuous finite element method in space and a modified midpoint scheme in time. We apply a penalty formulation to the continuity equation which may increase the stability in the pressure variable. Two kinds of immiscible fluids in a pipe and droplet displacement with a moving contact line under the effect of pressure driven shear flow are studied using a relatively coarse grid. We also derive the discrete energy law for the droplet displacement case, which is slightly different due to the boundary conditions. The accuracy and stability of the scheme are validated by examples, results and estimate order.