Adjust Processing code for use with Java