FileDialog 怎么选择一个文件夹,得到文件夹路径 输出
解决方案 »
- Map的keySet()用法
- 初学java 。无法用面向对象的思维。 而且就不知道程序如何架构起来。谁能帮我改改我的一个hash 查找
- 哪些javascript函数调用不带括号
- 13个就餐问题,拿刀拿叉问题,大家碰到过没,不知道谁能用JAVA来描述。
- 没分了。。。问一个 关于 JComboBox 索引值的问题
- 请教~~当鼠标经过HTML的表格td时.....
- JCREATOR使用中的一点问题!(谁帮我解决我就送分给谁)
- 心情不好,散分!
- java.sql.SQLException: No suitable driver
- java的安装
- java 中 类名.this 作用是什么??
- java和javac的版本不同
获得此文件对话框的目录。 这个是不是获取选中文件所在的文件夹的目录的~String getFile()
获得此文件对话框的选定文件。 获取选中文件的路径~
这个吗?
你new一个FileDialog之后不是要open吗?
open()之后你就能看到文件对话框了,直接选择文件,点“打开”
这时候open()方法返回的就是你选择的文件的路径。也就是String path = FileDialog.open()就好了。
open
public String open()Makes the dialog visible and brings it to the front of the display. Returns:
a string describing the absolute path of the first selected file, or null if the dialog was cancelled or an error Throws:
SWTException -
ERROR_WIDGET_DISPOSED - if the dialog has been disposed
ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog
* 向注册表更新配置信息
*/
public static void registerPDFCreator() {
add("UseAutosave", "1");
add("UpdateInterval", "0");
add("RemoveAllKnownFileExtensions", "1");
add("RemoveSpaces", "1");
add("FilenameSubstitutionsOnlyInTitle", "0");
add("Language", "english");
}