首页 > 文档 > selectFolder()打开文件选择器
2017
07-14

selectFolder()打开文件选择器

3-14.selectFolder()

Name(名称):

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.


打开特定于平台的文件选择器对话框以选择文件夹。 选择完成后,选择将被传递给’回调’功能。 如果对话框关闭或取消,将会将null发送到该函数,以便程序不等待其他输入。 回调是必要的,因为线程如何工作。

Syntax(语法):

 selectFolder(prompt, callback)

selectFolder(prompt, callback, file)

selectFolder(prompt, callback, file, callbackObject)

selectFolder(prompt, callbackMethod, defaultSelection, callbackObject, parentFrame)

selectFolder(prompt,callbackMethod,defaultSelection, callbackObject, parentFrame, sketch)

Parameters (参数):prompt——message to the user消息给用户

Callback——name of the method to be called when the selection is made在进行选择时要调用的方法的名称

Returns(返回值):Void(


 



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。