Facing trouble with communicating between arduino Mega 2560 and processing.

I recently bought a mega as for my project I was running short on pins. But now I am facing another issue. I followed this tutorial to setup data transfer from processing to arduino, https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/to-arduino. It was working fine on UNO. Now, when I am trying to run the exact same sketch on the mega, nothing at all is happening. I have tried searching online a lot regarding this issue, but found nothing relevant. Please help me out.

Is the sketch actually running on the Mega?