Hey thanks for this. Yeah I had in fact had a play with what you suggested before posting the comment but didn't post the tweaked code because the effect was not exactly what I was after. The line it draws does not seem to be able to connect previous point to current point, instead seems to draw a line at an angle from a random point on screen...so weird!
import java.awt.MouseInfo;
import java.awt.Point;
void setup() {
background(255);
size(screen.width, screen.height); // set window size
strokeWeight(.05); // set line thickness
stroke(0, 200); // black with tranparency
smooth();
}
void draw() {
Point mouse;
mouse = MouseInfo.getPointerInfo().getLocation();
println( "X=" + mouse.x + " Y=" + mouse.y );
line(mouse.x, mouse.y, pmouseX, pmouseY);
// draw lines from where mouse is to where mouse was 'pmouse' means previous
// (x, y, x2, y2)
if (mousePressed) {
fill(255);
ellipse(mouseX, mouseY, 5, 5);
} else {
fill(0);
}
}