Displaying Analog Readout with Processing

I can only get one analog readout to display with Processing. I need it to store data continuously. How do I do that?

Here is my code:

import processing.serial.*;
Serial myPort;
String bits;
PFont font;


void setup() {
 size(800,200);
 myPort = new Serial(this, "COM1", 9600);
 myPort.bufferUntil('\n');
 font = loadFont("TimesNewRomanPSMT-12.vlw");
 textFont(font);
}

void draw() {
 //The serialEvent controls the display
}

void serialEvent (Serial myPort){
 bits = myPort.readStringUntil();
 if(bits != null){
   bits=trim(bits);
 }

 writeText("Bits: " + bits);
}


void writeText(String textToWrite){
 background(255);
 fill(0);
 text(textToWrite, width/20, 10);
}

Thanks!

try this, i haven't tested anything, so i'm not sure if it will work, but i'm pretty sure it will
(i changed some stuff, commented, and changed the name of the string to bitStr, just to make sure we don't have a string 'text', hence the instruction name 'text()'

import processing.serial.*;
Serial myPort;
String bits;
PFont font;
String bitStr = "bits: -";

void setup() {
 size(800,200);
 myPort = new Serial(this, "COM1", 9600);
 myPort.bufferUntil('\n');
 font = loadFont("TimesNewRomanPSMT-12.vlw");
 textFont(font);
}

void draw() {
 background(255);
 fill(0);
 text(bitStr, width/20, 10); // draw text in the draw() loop, then you're sure it will be drawn continuously
}

void serialEvent (Serial myPort){
 bits = myPort.readStringUntil("\n"); // here you have to include "\n" as argument of readStringUntil
 if(bits != null){
   bits=trim(bits);
   bitStr = "bits: " + bits;
 }
else {
   bitStr = "bits: null"
}
 
}
 bits = myPort.readStringUntil();

Until what?

Here is my code:

No, that is half your code. Where is the Arduino half?