We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
createWriter (Read 802 times)
createWriter
Dec 26th, 2006, 1:21pm
 
I try to get text file of coordination of mouse pointer.
on javaapplet,successfully worked.
but on browser,applet don't work.

please comment how it will work...

source is below.
-------
PrintWriter output;

void setup() {
 output = createWriter("positions.txt"); // Create a new file in the sketch directory
}

void draw() {
 point(mouseX, mouseY);
 output.print(mouseX);
 output.print("  ");
 output.print(mouseY);
 output.println();// Write the coordinate to the file
}

void keyPressed() {
 output.flush(); // Writes the remaining data to the file
 output.close(); // Finishes the file
 exit(); // Stops the program
}
Re: createWriter
Reply #1 - Dec 26th, 2006, 6:13pm
 
Browser applets can't write to files unless they're signed, and the user accepts the certificate.
Page Index Toggle Pages: 1