关于文件对话框的问题,我想通过文件话框得到一个指定的目录
例如:
C:\WINNT\system
我要得到C:\WINNT这个目录,我就必须的进到system这个文件夹底下,要是进到C:\WINNT底下就只能得到C:\
是本来就的这样,还是......
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(fileChooser.DIRECTORIES_ONLY);
int n = fileChooser.showOpenDialog(this.getContentPane());
if(n==fileChooser.APPROVE_OPTION)
{
      File file = fileChooser.getCurrentDirectory();
      textFieldFileLocalDirectory.setText(file.getPath());
}