We consider simple mean field continuum models for first order liquid-liquid demixing and solid-liquid phase transitions and show how the Maxwell construction at phase coexistence emerges on going from finite-size closed systems to the thermodynamic limit. The theories considered are the Cahn-Hilliard model of phase separation, which is also a model for the liquid-gas transition, and the phase field crystal model of the solid-liquid transition. Our results show that states comprising the Maxwell line depend strongly on the mean density with spatially localized structures playing a key role in the approach to the thermodynamic limit.