I love this kind of thing! I made a Java/Processing version back in January, 2011: http://bluethen.com/wordpress/index.php/processing-apps/balls/
For a large number of evenly sized balls, I found that having a fixed sized grid for partitioning is a lot more efficient than quadtrees.
You also might want to check if they've already collided or not. Running the collision code twice for each collision may be what's causing some of the sticking.
Also, you should put a demo up somewhere!