Try the “fix” to SimpleWrite:
I corrected the link in previous post.
The Arduino code for it is in the examples in the Processing IDE and here:
https://github.com/processing/processing/tree/master/java/libraries/serial/examples:
After all that is said and done you need to get a simple working example going and then start layering more complex code.
Some references:
https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all
Serial Communication - SparkFun Learn Advanced and only here as a reference
:)