Skip to content

Instantly share code, notes, and snippets.

@MartinBspheroid
Created April 13, 2016 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinBspheroid/fec6c115ae6086e691c77c518b80076e to your computer and use it in GitHub Desktop.
Save MartinBspheroid/fec6c115ae6086e691c77c518b80076e to your computer and use it in GitHub Desktop.
import java.io.File;
long lastTime = 0;
File f;
String[] data;
void setup() {
f = new File("e:/test.txt");
}
void draw() {
background(0);
check();
for (int i = 0; i < data.length; i++) {
text(data[i], 10, 20 +(i*20));
}
}
void check() {
long millisec = f.lastModified();
if (millisec > lastTime) {
reload();
lastTime = millisec;
}
}
void reload() {
data = loadStrings(f.getAbsolutePath());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment