Arduino and processing updating sensor data print

**Hey all, I am using Arduino and Processing. On my Arduino I am simply using the Standard Firmata. My goal is for the sensor data of Arduino to be written out in Processing in a readable way. my first code (in processing) was:
This sort of "cheats" with the white rectangle over the text every-time to update to the new information. **

import processing.serial.;
import cc.arduino.
;

Arduino arduino;
int sensorpin = 0; // analog pin used to connect the sharp sensor
int val = 0; // variable to store the values from sensor(initially zero)

void setup()
{
//println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[0], 57600);
background(255);
size(1000, 1000);
}

void draw()
{
val=arduino.analogRead(sensorpin); // reads the value of the sharp sensor
stroke (255);
fill(255);
rect(0, 0, 400, 400);

if (val >= 0)
{
textSize(32);
fill(0, 102, 153, 204);
text("sensor pin value is ", 10, 30);
text(val, 10, 60);
println (val);
}
delay(300);

}

**** My second goals is for when there is a mouseclicked, I want the data to change color but to still update. This is where I am having trouble. The Sensor data changes to the current value in the new color when clicked but not in between (when not clicked) ... any ideas?****
import processing.serial.;
import cc.arduino.
;

Arduino arduino;
int sensorpin = 0; // analog pin used to connect the sharp sensor
int val = 0; // variable to store the values from sensor(initially zero)
int DayNight = 0;
void setup()
{
//println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[0], 57600);
background(255);
size(1800, 800);
}

void draw()
{
val=arduino.analogRead(sensorpin); // reads the value of the sharp sensor

}

void mouseClicked() {
if (DayNight == 0) {
val=arduino.analogRead(sensorpin);
stroke (255);
fill(255);
rect(0, 0, 400, 400);

fill(0, 102, 153, 204);
textSize(32);
text("sensor pin value is ", 10, 30);
text(val, 10, 60);
println (val);

DayNight = 1;
} else {
val=arduino.analogRead(sensorpin);
stroke (255);
fill(255);
rect(0, 0, 400, 400);

fill(0, 102, 13, 104);
textSize(32);
text("sensor pin value is ", 10, 30);
text(val, 10, 60);
println (val);
DayNight = 0;
}
}

This sort of "cheats" with the white rectangle over the text every-time to update to the new information. **

Each time through draw, you repaint the whole screen, so painting the white rectangle is not what obliterates the old text. Even if it was, that can not be considered cheating.

**** My second goals is for when there is a mouseclicked, I want the data to change color but to still update.

What data? you have (in the first code), three colors involved. Which one should be different?

The Sensor data changes to the current value in the new color when clicked but not in between (when not clicked) ... any ideas?****

The function that now does the work is called only when the mouse becomes clicked.

You can, in draw(), read whether the mouse is currently clicked. Put the code currently in the callback function back in draw, but set the value of DayNight based on whether the mouse is clicked, or not.