Matter can be either in solid,liquid or gas state  due to the change in temperature.
This is an animation of particle model for such situation.  
Because we need to add enough particles and calculated all the interactions between any two particles. the animation is a slow motion to illustrate a real situation.

VIEW or DOWNLOAD ejs xml source
then click to translate strings for selected locale.

Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop.

You can change the gravity and Temperature of the system. You can also drag any one of the green box to change the volume of the container.

A smaller attraction force between particle was assumed: F(r)=-k/r for 2D simulation (equilibrium to 1/r[sup]2[/sup] for 3D).

The initial state is g=10.0 and T=250K. Wait for a few minutes, you will find something similar to the following image, similar to a solid state.  Particles are located at nearly fixed locations.

If you increase the temperature , you might found the system change to liquid state. The particles try to fill the lower part of the container.  There are still attracted to each other and particle can moving around.

If you increase to even higher temperature, you will find the system change to gas state. Particles try to fill the whole volume of the container.