You are welcomed to check out [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=178.0]Browian motion[/url].
You will find several hundreds particles collide with each other without any problem.

It was created with ejs. And it is much easier to create simulation with EJS.
You are welcomed to download the jar file, run it and click right mouse button to open it in EJS. (You need to install EJS)
Then , you will find out all the code in EJS environment.
Good luck to your work. You are welcomed to share your code when you finish your work. ;-)