Can't get anything serial to work with processing

Clearly I am missing something. I tried the poormans oscilloscope. The other night "Black Screen"

Tonight I tried the "mouseover" program in the processing examples.

The processing window opens the mouseover is indicated in the processing window, the Arduino code is running and able to light the led, but it does not.

I put a "debug" in and it never gets any characters.

Below the processing screen it displays this -

Java lib Version = RXTX-2.1-7
[0] "COM1"
[1] "COM4"

I am using a USB to serial adapter on COM4

I tried to change this line to
port = new Serial(this, Serial.list()[1], 9600);

and it causes an error

// Open the port that the Arduino board is connected to (in this case #0)
// Make sure to open the port at the same speed Arduino is using (9600bps)
port = new Serial(this, Serial.list()[0], 9600);

What's a guy to do??

Post your full code. Then we will be able to assist you further.

You may want to review some example of serial communication.

and it causes an error

What error?

If the Arduino is attached to COM4,

port = new Serial(this, Serial.list()[1], 9600);

is correct.

Do you have the Arduino's Serial Monitor window open, too?

Revisited the code

port = new Serial(this, Serial.list()[1], 9600);

fixed the problem -thanks all