Serial stops returning data. java.io.IOException: Device not configured in write

So after it reads a \n charcter to put a "break" in the code?

You need to put a break; in the if(char == '\n') block. Otherwise, the program will keep reading any serial data that has been buffered. While there may not be any, it's still good practice to anticipate all possible conditions where adverse behavior could be introduced.

They are just temporary switches. Or whatever you call a switch that closes when its pressed down, and is open when its not pressed.

Momentary contact. Or, digital switches. So, why are you using analogRead() to read them?

I had a lot of false readings trying to read a HIGH/LOW signal from digital pins in the past

You need to debounce them, AND detect when the switch goes from pressed to released or released to pressed. Using analogRead() is NOT the answer. The reason that it appears to work is because it takes a lot longer to read a digital switch when pretending it is an analog device than it takes to read a digital switch, thereby doing the debouncing for you.

Post all of your Processing code, if you really want help.