Finally getting around to trying out the box2d library. More specifically, the java port of the original c++ lib. Google for JBox2D to find links.
Instead of doing the traditional Hello World with this library, which usually consists of just throwing objects around in a confined space, I have added a global magnetic repulsion force and assigned each particle a charge and density based on the size. The largest particles have a low density. Otherwise, they would try to make their way to the bottom of the enclosure.