If you've been working in Eclipse you have to make some minor adjustments to your Processing source code before you can render it on the web. Here's how to get started:
Here's a sample of what your code should look like
Now we can embed the code into a web page by doing the following:
Here's a live example (click and hold your mouse to release some colored balls)
If you are planning on using external artwork you will need to upload your assets to your website along with your PDE source code file. Then add the following "preloader" directive at the top of your sketch as a comment - this will tell ProcessingJS to have the files available when your sketch begins running.
/* @pjs preload="file1.png","file2.png","file3.jgp"; */