In trying to solve constrained optimization problems using genetic algorithms, the method to handle the constraints is the key factor to success. Some features of GA (genetic algorithms) and a large class of constrained optimization problems are taken into account and a new method called Fixed Proportion and Direct Comparison (FPDC) is proposed, which combines direct comparison method and the strategy to keep a fixed proportion of infeasible individuals. It is successfully integrated with the ordinary GA. Numerical results show that it is a general, effective and robust method.