Processing, button, void

Did you understand the principles?

Look at function mousePressed.

Hit ctrl-t to get correct indents!

It has one switch starting with
switch (state) {
and ending with
} // switch

Then it has case 0: ... etc. for the different states. Each case section must end with break; before the next case... begins.

Check this please.

You now have errors