This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.
Name |
selectFolder() |
Examples |
void setup() {
selectFolder("Select a folder to process:", "folderSelected");
}
void folderSelected(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
} else {
println("User selected " + selection.getAbsolutePath());
}
}
|
Description |
Opens a platform-specific file chooser dialog to select a folder. After the selection is made, the selection will be passed to the 'callback' function. If the dialog is closed or canceled, null will be sent to the function, so that the program is not waiting for additional input. The callback is necessary because of how threading works.
|
Syntax | selectFolder(prompt, callback)
selectFolder(prompt, callback, file)
selectFolder(prompt, callback, file, callbackObject)
selectFolder(prompt, callbackMethod, defaultSelection, callbackObject, parentFrame) |
Parameters |
prompt |
String: message to the user |
callback |
String: name of the method to be called when the selection is made |
|
Returns | void |
Updated on May 19, 2014 05:30:00pm PDT