Serial connection between Arduino and Processing doesn't work; Port busy

Hello,

You are running this multiple times and it will be busy after the first time:

  if (device_detected && runonce) 
    {
    //delay(1000);
    text("Device detected:", 20, 110);
    textFont(fnt, 18);
    text(detected_port, 20, 150);
    println(detected_port);
    ser_port = new Serial(this, detected_port, 9600);
    runonce = false;
    printArray(Serial.list());
    }

I added a:
boolean runonce = true;
and it seems to work.

You will have to modify code to display COM port in draw since this is only displayed once now.

:)