Arduino and Processing communication

That snippet makes it appear that serialEvent() is defined inside the draw() function. That is most certainly NOT allowed.

It is why we don't want you posting snippets. Post ALL of your code.