to fft123: FileDialog fd = new FileDialog((Frame)this.getParent(),"选择文件夹",FileDialog.LOAD); fd.show(); this.jTextPath.setText(fd.getDirectory());
void setFileSelectionMode(int mode) Sets the JFileChooser to allow the user to just select files, just select directories, or select both files and directories. JFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
FileDialog fd = new FileDialog((Frame)this.getParent(),"选择文件夹",FileDialog.LOAD);
fd.show();
this.jTextPath.setText(fd.getDirectory());
Sets the JFileChooser to allow the user to just select files, just select directories, or select both files and directories. JFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)