谁说没人知道的首先new 一个JFileChooser的对象
JFileChooser jFileChooser=new JFileChooser("c:\\");
参数的意义是那个文件对话框打开时的默认路径然后定义一个整形值
int result=jFileChooser.showOpenDialog(dialog);
参数的意义是文件选择器的附属窗口然后判断
if(result==JFileChooser.APPROVE_OPTION)
意义是判断用户点击了“确定”按钮然后定义文件
File f=jFileChooser.getSelectFile();就可以保存在指定文件了