i was trying to make a programm where if i klick a button, i can select an image! but if i try it just opens the selector over and over until my pc crashes!
void setup() {
size(960,540);
}
void draw() {
if(mousePressed) {
selectOutput("Select a file to write to:", "fileSelected");
}
}
void fileSelected(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
} else {
println("User selected " + selection.getAbsolutePath());
}
}
edit cause i wanted to make the code highlight and didnt got it 1st time!