First, I started with testing the serial commands to turn on/off the led by simply typing inside the serial monitor the letter "t" in my case. This was pretty straight-forward but to give us an idea of how we can send the signals to arduino from the laptop and specifically the serial monitor.
Then, I created a Box in Processing which when clicked can turn on the LED on the arduino by simulating what i did in the first step where i sent the letter "t" to the serial connected ( the serial port number must be known) to turn on the led. To do this I imported ControlP5 library using use the Library Manager from the menu under Sketch → Import Library → Add Library and searched for ControlP5. The reason why we chose this library is that becuase it contains controllers to build a graphical user interface on top of processing sketch to include Sliders, Buttons, Toggles etc. and can be easily added to a processing sketch, a complete list of features can be found
here. Then the "cp5.addButton("Button")" was used to create the Box. On the arduino side, the same code was used as in the first step.
Downloads