final JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
String fileName = fc.getSelectedFile().getName();
String path = (new File(fileName)).getAbsolutePath();
}
我得到的绝对路径是项目目录和文件名的拼接!JFileChooser返回错误的文件名?