站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2SE 专题问一个JFileChooser的问题

问一个JFileChooser的问题

摘要: 问一个JFileChooser的问题


用什么方法返回的是一个文件夹的路径,而不是文件的路径?


setFileSelectionMode
public void setFileSelectionMode(int mode)
Sets the JFileChooser to allow the user to just select files, just select directories, or select both files and directories. The default is JFilesChooser.FILES_ONLY.

Parameters:
mode - the type of files to be displayed:
JFileChooser.FILES_ONLY
JFileChooser.DIRECTORIES_ONLY
JFileChooser.FILES_AND_DIRECTORIES
Throws:
IllegalArgumentException - if mode is an illegal file selection mode
See Also:
getFileSelectionMode()


↑返回目录
前一篇: class文件命名问题
后一篇: javac 寻找路径的问题