In this paper, we developed a novel morphing surface technique consisting of a 3D printed miniature groove structure and injected stimuli-responsive hydrogel pattern, which is capable of switching between lipophilicity and oleophobicity under certain stimuli. Under swelling, the geometrical change of the hydrogel will buckle the surface due to the structural confinement and create a continuous transition of surface topology. Thus, it will yield a change in the surface wetting property from oleophilic to super-oleophobic with a contact angle of oil of 85° to 165°. We quantitatively investigate this structure-property relationship using finite element analysis and analytical modeling, and the simulation results and the modeling are in good agreement with the experimental ones. This morphing surface also holds potential to be developed into an autonomous system for future sub-sea/off-shore engineering applications to separate oil and water.